aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/_imp.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2019-10-28 21:52:40 -0400
committerJason R. Coombs <jaraco@jaraco.com>2019-10-28 21:52:40 -0400
commit3a0520b43dfac9f6ba507c6d09a60290219a0802 (patch)
tree1554961d791f0ccae876eec933ff6e678254016a /setuptools/_imp.py
parent2f4952927e41643100e6e6f58124f34331c14add (diff)
downloadexternal_python_setuptools-3a0520b43dfac9f6ba507c6d09a60290219a0802.tar.gz
external_python_setuptools-3a0520b43dfac9f6ba507c6d09a60290219a0802.tar.bz2
external_python_setuptools-3a0520b43dfac9f6ba507c6d09a60290219a0802.zip
Extract compatibility function into compatibility module.
Diffstat (limited to 'setuptools/_imp.py')
-rw-r--r--setuptools/_imp.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/setuptools/_imp.py b/setuptools/_imp.py
index 49ddc852..ee719c9a 100644
--- a/setuptools/_imp.py
+++ b/setuptools/_imp.py
@@ -8,6 +8,8 @@ import sys
import importlib.util
import importlib.machinery
+from .py34compat import module_from_spec
+
PY_SOURCE = 1
PY_COMPILED = 2
@@ -63,12 +65,6 @@ def get_frozen_object(module, paths):
return spec.loader.get_code(_resolve(module))
-def _module_from_spec(spec):
- if sys.version_info >= (3, 5):
- return importlib.util.module_from_spec(spec)
- else:
- return spec.loader.load_module(spec.name)
-
def get_module(module, paths, info):
spec = importlib.util.find_spec(module, paths)
- return _module_from_spec(spec)
+ return module_from_spec(spec)