diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2020-01-19 14:33:42 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2020-01-19 14:33:42 -0500 |
| commit | 3463820b30f2b09fee9a5fe42f86f5fe53d7f185 (patch) | |
| tree | 8573f0834fdbbef8b6bd91abf0bdaec892a6ca1e /setuptools/namespaces.py | |
| parent | bbf825eee764cae0bc44077ccc957a733d53d095 (diff) | |
| parent | c9fb0772fb3c147fce7affe7fcd0aa96435005d2 (diff) | |
| download | python-setuptools-git-3463820b30f2b09fee9a5fe42f86f5fe53d7f185.tar.gz | |
Merge branch 'master' into patch-1
Diffstat (limited to 'setuptools/namespaces.py')
| -rw-r--r-- | setuptools/namespaces.py | 16 |
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)", ) |
