diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2019-10-28 21:52:40 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2019-10-28 21:52:40 -0400 |
commit | 3a0520b43dfac9f6ba507c6d09a60290219a0802 (patch) | |
tree | 1554961d791f0ccae876eec933ff6e678254016a /setuptools/_imp.py | |
parent | 2f4952927e41643100e6e6f58124f34331c14add (diff) | |
download | external_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.py | 10 |
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) |