Skip to content

Commit

Permalink
Merge pull request #2249 from alexhenrie/imp
Browse files Browse the repository at this point in the history
Change exec_module to load_module
  • Loading branch information
jaraco authored Jul 12, 2020
2 parents 6d3250f + b69029f commit 8b45da0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/2249.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix extension loading technique in stubs.
2 changes: 1 addition & 1 deletion setuptools/command/bdist_egg.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __bootstrap__():
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:
Expand Down
2 changes: 1 addition & 1 deletion setuptools/command/build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def write_stub(self, output_dir, ext, compile=False):
" 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)",
Expand Down

0 comments on commit 8b45da0

Please sign in to comment.