Skip to content

Commit 9ddc7af

Browse files
Make use of Python 3.7's standard library importlib.resources
There is a hardcoded dependency on the third-party module `importlib_resources`, which is `a backport of Python 3.7's standard library importlib.resources module for Python 2.7, and 3.4 through 3.6`. Thus, let's use the standard one for Python3.7 and above. Signed-off-by: Stanislav Levin <[email protected]>
1 parent da510e3 commit 9ddc7af

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

importlib_metadata/tests/test_zip.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
import unittest
33
import importlib_metadata
44

5-
from importlib_resources import path
5+
try:
6+
from importlib_resources import path
7+
except ImportError:
8+
from importlib.resources import path
69

710
try:
811
from contextlib import ExitStack

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ passenv =
2525
deps =
2626
cov,diffcov: coverage>=4.5
2727
diffcov: diff_cover
28-
importlib_resources
28+
importlib_resources; python_version < "3.7"
2929
py27: contextlib2
3030
pip >= 18
3131
packaging

0 commit comments

Comments
 (0)