aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/bdist_egg.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-07-03 15:11:32 -0400
committerGitHub <noreply@github.com>2020-07-03 15:11:32 -0400
commit5f151cbbcd6c65f7f48082bfaf36db3a55df936e (patch)
treeeb721c8957ee48c5149af6742a27a449fb618027 /setuptools/command/bdist_egg.py
parenta9eb9e73def8ca6c469e59f1b008746e368ad4c1 (diff)
parenta877dab0bddaeb5503d871794ca06f1c81d805b8 (diff)
downloadexternal_python_setuptools-5f151cbbcd6c65f7f48082bfaf36db3a55df936e.tar.gz
external_python_setuptools-5f151cbbcd6c65f7f48082bfaf36db3a55df936e.tar.bz2
external_python_setuptools-5f151cbbcd6c65f7f48082bfaf36db3a55df936e.zip
Merge branch 'master' into 2020-06-11-raise-from
Diffstat (limited to 'setuptools/command/bdist_egg.py')
-rw-r--r--setuptools/command/bdist_egg.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py
index 1b28d4c9..e94fe252 100644
--- a/setuptools/command/bdist_egg.py
+++ b/setuptools/command/bdist_egg.py
@@ -55,10 +55,11 @@ def write_stub(resource, pyfile):
_stub_template = textwrap.dedent("""
def __bootstrap__():
global __bootstrap__, __loader__, __file__
- import sys, pkg_resources, imp
+ import sys, pkg_resources
+ from importlib.machinery import ExtensionFileLoader
__file__ = pkg_resources.resource_filename(__name__, %r)
__loader__ = None; del __bootstrap__, __loader__
- imp.load_dynamic(__name__,__file__)
+ ExtensionFileLoader(__name__,__file__).exec_module()
__bootstrap__()
""").lstrip()
with open(pyfile, 'w') as f: