Commit 170aca9
authored
Fix ResourceReader ImportError exception on Python 3.14 (#299)
importlib.abc.ResourceReader moved to importlib.resources.abc.ResourceReader
in Python 3.11. The old location was deprecated in 3.11 and removed in 3.14.
TraversableResources is now the preferred API, but AIUI ResourceReader has no
formal deprecation at the new location. I've chosen an if/else block because
it is interpretted by MyPy, as opposed to try/except ImportError which MyPy
cannot type check on Python <= 3.10.1 parent 0c8b57e commit 170aca9
2 files changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
0 commit comments