summaryrefslogtreecommitdiff
path: root/setuptools/namespaces.py
diff options
context:
space:
mode:
authorBastian Venthur <bastian.venthur@flixbus.com>2020-02-11 09:55:35 +0100
committerBastian Venthur <bastian.venthur@flixbus.com>2020-02-11 09:55:35 +0100
commit087c3b26eed9b6a8960815c2773edd04b5c91a98 (patch)
treec0b0bf68b6f02980f742611c9232405ab9df299b /setuptools/namespaces.py
parentc11270aa6bffd8913c6e074f09b9d920c8f19002 (diff)
parenta5dec2f14e3414e4ee5dd146bff9c289d573de9a (diff)
downloadpython-setuptools-git-087c3b26eed9b6a8960815c2773edd04b5c91a98.tar.gz
Merge branch 'master' into fix/1700
Diffstat (limited to 'setuptools/namespaces.py')
-rw-r--r--setuptools/namespaces.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/setuptools/namespaces.py b/setuptools/namespaces.py
index dc16106d..5f403c96 100644
--- a/setuptools/namespaces.py
+++ b/setuptools/namespaces.py
@@ -47,13 +47,17 @@ class Installer:
"p = os.path.join(%(root)s, *%(pth)r)",
"importlib = has_mfs and __import__('importlib.util')",
"has_mfs and __import__('importlib.machinery')",
- "m = has_mfs and "
+ (
+ "m = has_mfs and "
"sys.modules.setdefault(%(pkg)r, "
- "importlib.util.module_from_spec("
- "importlib.machinery.PathFinder.find_spec(%(pkg)r, "
- "[os.path.dirname(p)])))",
- "m = m or "
- "sys.modules.setdefault(%(pkg)r, types.ModuleType(%(pkg)r))",
+ "importlib.util.module_from_spec("
+ "importlib.machinery.PathFinder.find_spec(%(pkg)r, "
+ "[os.path.dirname(p)])))"
+ ),
+ (
+ "m = m or "
+ "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)",
)