Commit 6a5145a0 authored by Jason R. Coombs's avatar Jason R. Coombs

Based on experimentation, the canonical module name needs to be in sys.modules...

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
parent 2dc55bc1
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment