Skip to content

Commit 60499cd

Browse files
committed
use backported importlib.resources on older versions of python
1 parent 441b3bb commit 60499cd

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
packages=find_packages(exclude=['tests.*', 'tests']),
1818
install_requires=[
19+
'importlib-resources',
1920
'numpy>=1.14',
2021
'matplotlib',
2122
'scipy',

tests/test_access_resources.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
from importlib.resources import read_text, contents, files
1+
try:
2+
from importlib.resources import read_text, contents, files # type:ignore
3+
except ModuleNotFoundError:
4+
from importlib_resources import read_text, contents, files # type:ignore
25
from unittest import TestCase
36
import mascado.resources as res
47

0 commit comments

Comments
 (0)