diff options
| author | Andrew Murray <radarhere@users.noreply.github.com> | 2020-08-10 21:10:46 +1000 |
|---|---|---|
| committer | Andrew Murray <radarhere@users.noreply.github.com> | 2020-08-10 21:10:46 +1000 |
| commit | 33c9d86af4dc1df04cf1b38a0102fe7e121173ec (patch) | |
| tree | 28520c99830a9be2692677aae55907e8e92ab33a /setuptools/command/bdist_egg.py | |
| parent | 5e60dc50e540a942aeb558aabe7d92ab7eb13d4b (diff) | |
| download | python-setuptools-git-33c9d86af4dc1df04cf1b38a0102fe7e121173ec.tar.gz | |
Change load_module to exec_module
Diffstat (limited to 'setuptools/command/bdist_egg.py')
| -rw-r--r-- | setuptools/command/bdist_egg.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py index 7af3165c..4be15457 100644 --- a/setuptools/command/bdist_egg.py +++ b/setuptools/command/bdist_egg.py @@ -55,11 +55,12 @@ def write_stub(resource, pyfile): _stub_template = textwrap.dedent(""" def __bootstrap__(): global __bootstrap__, __loader__, __file__ - import sys, pkg_resources - from importlib.machinery import ExtensionFileLoader + import sys, pkg_resources, importlib.util __file__ = pkg_resources.resource_filename(__name__, %r) __loader__ = None; del __bootstrap__, __loader__ - ExtensionFileLoader(__name__,__file__).load_module() + spec = importlib.util.spec_from_file_location(__name__,__file__) + mod = importlib.util.module_from_spec(spec) + spec.loader.exec_module(mod) __bootstrap__() """).lstrip() with open(pyfile, 'w') as f: |
