diff options
author | Alex Henrie <alexhenrie24@gmail.com> | 2020-06-21 16:39:53 -0600 |
---|---|---|
committer | Alex Henrie <alexhenrie24@gmail.com> | 2020-06-21 16:39:53 -0600 |
commit | 4516d87036f971a4c98900301b6354c0aae73dc8 (patch) | |
tree | 77c560616611e46f880294751b1f8d5dd2a9fa84 /setuptools/command/bdist_egg.py | |
parent | 145a78cdc1afb4ce0c0208ae86a00708eb79d27b (diff) | |
download | python-setuptools-git-4516d87036f971a4c98900301b6354c0aae73dc8.tar.gz |
Use importlib instead of imp in __bootstrap__ functions
Diffstat (limited to 'setuptools/command/bdist_egg.py')
-rw-r--r-- | setuptools/command/bdist_egg.py | 5 |
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: |