summaryrefslogtreecommitdiff
path: root/setuptools/namespaces.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-05-15 06:13:10 -0400
committerJason R. Coombs <jaraco@jaraco.com>2020-05-15 06:13:10 -0400
commit619e229c9777f0ee0851d8c5c94caaad7d89d434 (patch)
tree2013eec1df4def402792a3b932d904b714b7e493 /setuptools/namespaces.py
parentb0657c80db7891a9eca038199d5d4c2e2bafed03 (diff)
parente04c75ab906caadff4609ef34de8973c8e92eff8 (diff)
downloadpython-setuptools-git-619e229c9777f0ee0851d8c5c94caaad7d89d434.tar.gz
Merge branch 'master' into docs/setup.cfg-only
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)",
)