From: Alexandre Detiste Date: Sat, 21 Mar 2026 13:38:07 +0100 Subject: Patch out usage of importlib_resources Bug-Debian: https://bugs.debian.org/1111880 Forwarded: not-needed Reviewed-By: Jakob Haufe Last-Update: 2025-11-08 --- pyocd/debug/sequences/default_sequences.py | 4 ++-- pyocd/debug/svd/loader.py | 4 ++-- setup.cfg | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pyocd/debug/sequences/default_sequences.py b/pyocd/debug/sequences/default_sequences.py index a4dbd5a..07ad29b 100644 --- a/pyocd/debug/sequences/default_sequences.py +++ b/pyocd/debug/sequences/default_sequences.py @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import importlib_resources +import importlib.resources import logging import yaml @@ -105,7 +105,7 @@ class DefaultDebugSequences(_YAMLSequenceParser): def _load_default_sequences(cls) -> FrozenSet[DebugSequence]: """Load default sequences from YAML file.""" try: - resource_path = importlib_resources.files('pyocd.debug.sequences') / 'default_sequences.yaml' + resource_path = importlib.resources.files('pyocd.debug.sequences') / 'default_sequences.yaml' with resource_path.open('r') as f: yaml_data = yaml.safe_load(f) or {} except FileNotFoundError: diff --git a/pyocd/debug/svd/loader.py b/pyocd/debug/svd/loader.py index ee58f1e..39a1e7f 100644 --- a/pyocd/debug/svd/loader.py +++ b/pyocd/debug/svd/loader.py @@ -17,7 +17,7 @@ import threading import logging -import importlib_resources +import importlib.resources import zipfile from .parser import SVDParser @@ -31,7 +31,7 @@ class SVDFile(object): @classmethod def from_builtin(cls, svd_name): try: - zip_ref = importlib_resources.files("pyocd").joinpath(BUILTIN_SVD_DATA_PATH) + zip_ref = importlib.resources.files("pyocd").joinpath(BUILTIN_SVD_DATA_PATH) zip_stream = zip_ref.open('rb') zip = zipfile.ZipFile(zip_stream, 'r') return SVDFile(zip.open(svd_name)) diff --git a/setup.cfg b/setup.cfg index 07f40b1..254f7dd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -56,7 +56,6 @@ install_requires = colorama<1.0 hidapi>=0.10.1,<1.0; platform_system != "Linux" importlib_metadata>=3.6 - importlib_resources intelhex>=2.0,<3.0 intervaltree>=3.0.2,<4.0 lark>=1.1.5,<2.0