Skip to content

Commit

Permalink
Use create_module()/exec_module() instead of load_module() where poss…
Browse files Browse the repository at this point in the history
…ible

Fixes pypa#2481
  • Loading branch information
hroncok committed Jan 4, 2021
1 parent 95a9c47 commit 3f1b70e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg_resources/extern/__init__.py
Expand Up @@ -54,6 +54,12 @@ def load_module(self, fullname):
"distribution.".format(**locals())
)

def create_module(self, spec):
return self.load_module(spec.name)

def exec_module(self, module):
pass

def install(self):
"""
Install this importer into sys.meta_path if not already present.
Expand Down
6 changes: 6 additions & 0 deletions setuptools/extern/__init__.py
Expand Up @@ -54,6 +54,12 @@ def load_module(self, fullname):
"distribution.".format(**locals())
)

def create_module(self, spec):
return self.load_module(spec.name)

def exec_module(self, module):
pass

def install(self):
"""
Install this importer into sys.meta_path if not already present.
Expand Down

0 comments on commit 3f1b70e

Please sign in to comment.