From 8b4ce333c093f459698c0545550269a393387c5f Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Sat, 11 Jul 2020 12:51:48 -0600 Subject: [PATCH] Change exec_module to load_module Fixes #2246 --- setuptools/command/bdist_egg.py | 2 +- setuptools/command/build_ext.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py index e94fe25250..7af3165cd5 100644 --- a/setuptools/command/bdist_egg.py +++ b/setuptools/command/bdist_egg.py @@ -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: diff --git a/setuptools/command/build_ext.py b/setuptools/command/build_ext.py index 327fa06335..0eb29adc8b 100644 --- a/setuptools/command/build_ext.py +++ b/setuptools/command/build_ext.py @@ -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)",