Commit a76f5c03 authored by Jason R. Coombs's avatar Jason R. Coombs

Pop the module off the stack, preventing the 'Version' class from having a...

Pop the module off the stack, preventing the 'Version' class from having a different manifestation in packaging than in pkg_resources.

--HG--
branch : feature/issue-229
parent de5caaee
...@@ -28,8 +28,7 @@ class VendorImporter: ...@@ -28,8 +28,7 @@ class VendorImporter:
for prefix in self.search_path: for prefix in self.search_path:
try: try:
__import__(prefix + target) __import__(prefix + target)
mod = sys.modules[prefix + target] mod = sys.modules[fullname] = sys.modules.pop(prefix + target)
sys.modules[fullname] = mod
return mod return mod
except ImportError: except ImportError:
pass pass
......
...@@ -28,8 +28,7 @@ class VendorImporter: ...@@ -28,8 +28,7 @@ class VendorImporter:
for prefix in self.search_path: for prefix in self.search_path:
try: try:
__import__(prefix + target) __import__(prefix + target)
mod = sys.modules[prefix + target] mod = sys.modules[fullname] = sys.modules.pop(prefix + target)
sys.modules[fullname] = mod
return mod return mod
except ImportError: except ImportError:
pass 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