From 88b83f23fa4740946b1ac5cb92617f18f4444244 Mon Sep 17 00:00:00 2001 From: Antoine van Gelder Date: Wed, 29 Jan 2025 13:44:46 +0200 Subject: [PATCH] repo: remove deprecated usage of importlib_resources --- cynthion/python/src/commands/util.py | 5 +---- cynthion/python/src/shared.py | 13 ++++--------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/cynthion/python/src/commands/util.py b/cynthion/python/src/commands/util.py index cb600ace..bd03061e 100644 --- a/cynthion/python/src/commands/util.py +++ b/cynthion/python/src/commands/util.py @@ -16,10 +16,7 @@ import textwrap import usb -try: - from importlib_resources import files # <= 3.8 -except: - from importlib.resources import files # >= 3.9 +from importlib.resources import files from cynthion import shared from fwup.dfu import DFUTarget diff --git a/cynthion/python/src/shared.py b/cynthion/python/src/shared.py index 3ce91c8f..3f16ef9f 100644 --- a/cynthion/python/src/shared.py +++ b/cynthion/python/src/shared.py @@ -11,15 +11,10 @@ import glob import tomli -from collections import namedtuple -try: - # <= 3.8 - from importlib_resources import files -except: - # >= 3.9 - from importlib.resources import files -from os import path -from pathlib import Path +from collections import namedtuple +from importlib.resources import files +from os import path +from pathlib import Path SHARED_TOML_PATH = Path(files("cynthion").joinpath("shared"))