summaryrefslogtreecommitdiff
path: root/setuptools/namespaces.py
diff options
context:
space:
mode:
authorJohannes Reiff <mail@jreiff.de>2020-01-25 14:17:40 +0100
committerGitHub <noreply@github.com>2020-01-25 14:17:40 +0100
commit6ee1a1ce60c6d039c63def3c2aeba7e0f39e7507 (patch)
tree254243b04be614ee4ea346ccb7c25fb9deb11f5f /setuptools/namespaces.py
parentec270f9e13fcc32a2a861273219ebfeba17838df (diff)
parent73376585065bbf28395c71fe15137c19a712d4f3 (diff)
downloadpython-setuptools-git-6ee1a1ce60c6d039c63def3c2aeba7e0f39e7507.tar.gz
Merge branch 'master' into pr-easyinstall
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)",
)