summaryrefslogtreecommitdiff
path: root/pkg_resources/extern
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-01-02 16:14:44 -0500
committerJason R. Coombs <jaraco@jaraco.com>2016-01-02 16:14:44 -0500
commit6a5145a04f1c7f671620c0146a2ce0241afee60c (patch)
treef85698b43d7f7b358d63a95a8c9af6e2f1c4b48f /pkg_resources/extern
parent2dc55bc1a9904ffd44d4cd5a3c83c7a1f12c75ec (diff)
downloadpython-setuptools-git-6a5145a04f1c7f671620c0146a2ce0241afee60c.tar.gz
Based on experimentation, the canonical module name needs to be in sys.modules on Python prior to 3.3, but must be omitted on Python 3.3 and later.
--HG-- branch : feature/issue-229
Diffstat (limited to 'pkg_resources/extern')
-rw-r--r--pkg_resources/extern/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg_resources/extern/__init__.py b/pkg_resources/extern/__init__.py
index 944967c2..9b1599f8 100644
--- a/pkg_resources/extern/__init__.py
+++ b/pkg_resources/extern/__init__.py
@@ -29,7 +29,10 @@ class VendorImporter:
for prefix in self.search_path:
try:
__import__(prefix + target)
- mod = sys.modules[fullname] = sys.modules.pop(prefix + target)
+ mod = sys.modules[prefix + target]
+ sys.modules[fullname] = mod
+ if sys.version_info > (3, 3):
+ del sys.modules[prefix + target]
return mod
except ImportError:
pass