aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pkg_resources/extern/__init__.py3
-rw-r--r--setuptools/extern/__init__.py3
2 files changed, 2 insertions, 4 deletions
diff --git a/pkg_resources/extern/__init__.py b/pkg_resources/extern/__init__.py
index 17a582ea..b7f87ee9 100644
--- a/pkg_resources/extern/__init__.py
+++ b/pkg_resources/extern/__init__.py
@@ -28,8 +28,7 @@ class VendorImporter:
for prefix in self.search_path:
try:
__import__(prefix + target)
- mod = sys.modules[prefix + target]
- sys.modules[fullname] = mod
+ mod = sys.modules[fullname] = sys.modules.pop(prefix + target)
return mod
except ImportError:
pass
diff --git a/setuptools/extern/__init__.py b/setuptools/extern/__init__.py
index 1329285c..e1400238 100644
--- a/setuptools/extern/__init__.py
+++ b/setuptools/extern/__init__.py
@@ -28,8 +28,7 @@ class VendorImporter:
for prefix in self.search_path:
try:
__import__(prefix + target)
- mod = sys.modules[prefix + target]
- sys.modules[fullname] = mod
+ mod = sys.modules[fullname] = sys.modules.pop(prefix + target)
return mod
except ImportError:
pass