Skip to content

Commit

Permalink
Based on experimentation, the canonical module name needs to be in sy…
Browse files Browse the repository at this point in the history
…s.modules on Python prior to 3.3, but must be omitted on Python 3.3 and later.

--HG--
branch : feature/issue-229
  • Loading branch information
jaraco committed Jan 2, 2016
1 parent 2dc55bc commit 6a5145a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg_resources/extern/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ def load_module(self, fullname):
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
Expand Down

0 comments on commit 6a5145a

Please sign in to comment.