aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-12-07 21:24:21 -0500
committerJason R. Coombs <jaraco@jaraco.com>2016-12-07 21:24:21 -0500
commit17f72f5bc7031accc037b377ced5a0b411520bfb (patch)
treea3ce509eddae6e631f5ffff1ebd573f042499a3d
parent41a9da1833b1f55b4a3da0d427e9b569075f0cc7 (diff)
downloadexternal_python_setuptools-17f72f5bc7031accc037b377ced5a0b411520bfb.tar.gz
external_python_setuptools-17f72f5bc7031accc037b377ced5a0b411520bfb.tar.bz2
external_python_setuptools-17f72f5bc7031accc037b377ced5a0b411520bfb.zip
Always check at run time as some builds share files across Python versions.
-rwxr-xr-xsetuptools/namespaces.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/setuptools/namespaces.py b/setuptools/namespaces.py
index 9266860f..2399dae5 100755
--- a/setuptools/namespaces.py
+++ b/setuptools/namespaces.py
@@ -37,15 +37,15 @@ class Installer:
_nspkg_tmpl = (
"import sys, types, os, importlib.util, importlib.machinery",
"pep420 = sys.version_info > (3, 3)",
+ "has_mfs = sys.version_info > (3, 5)",
"p = os.path.join(%(root)s, *%(pth)r)",
"ie = os.path.exists(os.path.join(p,'__init__.py'))",
- "m = not ie and not pep420 and "
+ "m = not ie and not pep420 and has_mfs and "
"sys.modules.setdefault(%(pkg)r, "
"importlib.util.module_from_spec("
"importlib.machinery.PathFinder.find_spec(%(pkg)r, "
- "[os.path.dirname(p)])))"
- if sys.version_info >= (3, 5) else
- "m = not ie and not pep420 and "
+ "[os.path.dirname(p)])))",
+ "m = not ie and not pep420 and not has_mfs and "
"sys.modules.setdefault(%(pkg)r, types.ModuleType(%(pkg)r))",
"mp = (m or []) and m.__dict__.setdefault('__path__',[])",
"(p not in mp) and mp.append(p)",