File: patch_out_importlib_resources

package info (click to toggle)
pyocd 0.36.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 341,216 kB
  • sloc: xml: 3,682,260; python: 59,213; ansic: 112; makefile: 87; asm: 25; sh: 14
file content (41 lines) | stat: -rw-r--r-- 1,324 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Description: Patch out usage of importlib_resources
Author: Alexandre Detiste <alexandre.detiste@gmail.com>
Bug-Debian: https://bugs.debian.org/1111880
Forwarded: no
Reviewed-By: Jakob Haufe <sur5r@debian.org>
Last-Update: 2025-11-08

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 d27543a..fb4e4fc 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -55,7 +55,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