summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-07-12 03:50:31 -0400
committerGitHub <noreply@github.com>2020-07-12 03:50:31 -0400
commit8b45da017d51aa3b0a541f3234732ff3047d9e06 (patch)
tree78354f747fe8a8e79fde58f25f3e2b88053fdb67
parent6d3250fa1ea1a309e8e45737d0a1dccbbd3f95e4 (diff)
parentb69029f753e061359adc554b2f5c600a2d143bf9 (diff)
downloadpython-setuptools-git-8b45da017d51aa3b0a541f3234732ff3047d9e06.tar.gz
Merge pull request #2249 from alexhenrie/imp
Change exec_module to load_module
-rw-r--r--changelog.d/2249.misc.rst1
-rw-r--r--setuptools/command/bdist_egg.py2
-rw-r--r--setuptools/command/build_ext.py2
3 files changed, 3 insertions, 2 deletions
diff --git a/changelog.d/2249.misc.rst b/changelog.d/2249.misc.rst
new file mode 100644
index 00000000..14742dc3
--- /dev/null
+++ b/changelog.d/2249.misc.rst
@@ -0,0 +1 @@
+Fix extension loading technique in stubs.
diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py
index e94fe252..7af3165c 100644
--- a/setuptools/command/bdist_egg.py
+++ b/setuptools/command/bdist_egg.py
@@ -59,7 +59,7 @@ def write_stub(resource, pyfile):
from importlib.machinery import ExtensionFileLoader
__file__ = pkg_resources.resource_filename(__name__, %r)
__loader__ = None; del __bootstrap__, __loader__
- ExtensionFileLoader(__name__,__file__).exec_module()
+ ExtensionFileLoader(__name__,__file__).load_module()
__bootstrap__()
""").lstrip()
with open(pyfile, 'w') as f:
diff --git a/setuptools/command/build_ext.py b/setuptools/command/build_ext.py
index 327fa063..0eb29adc 100644
--- a/setuptools/command/build_ext.py
+++ b/setuptools/command/build_ext.py
@@ -268,7 +268,7 @@ class build_ext(_build_ext):
" os.chdir(os.path.dirname(__file__))",
if_dl(" sys.setdlopenflags(dl.RTLD_NOW)"),
" ExtensionFileLoader(__name__,",
- " __file__).exec_module()",
+ " __file__).load_module()",
" finally:",
if_dl(" sys.setdlopenflags(old_flags)"),
" os.chdir(old_dir)",