aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/namespaces.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-03-07 15:41:51 -0500
committerJason R. Coombs <jaraco@jaraco.com>2020-03-07 15:41:51 -0500
commitda94b05088d9bddb6ba0cd5a1b236e99985816c0 (patch)
tree8a78ccd2d459e7702d914cb35e29f5f661e5bf5a /setuptools/namespaces.py
parent6980b9c8fed113f1046099924e16287662beff5f (diff)
parent25edd1951d8d44c34578c926f5c20ed3d452587b (diff)
downloadexternal_python_setuptools-da94b05088d9bddb6ba0cd5a1b236e99985816c0.tar.gz
external_python_setuptools-da94b05088d9bddb6ba0cd5a1b236e99985816c0.tar.bz2
external_python_setuptools-da94b05088d9bddb6ba0cd5a1b236e99985816c0.zip
Merge remote-tracking branch 'origin/master' into debt/remove-features
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)",
)