summaryrefslogtreecommitdiff
path: root/setuptools/command/build_ext.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-07-03 15:11:32 -0400
committerGitHub <noreply@github.com>2020-07-03 15:11:32 -0400
commit5f151cbbcd6c65f7f48082bfaf36db3a55df936e (patch)
treeeb721c8957ee48c5149af6742a27a449fb618027 /setuptools/command/build_ext.py
parenta9eb9e73def8ca6c469e59f1b008746e368ad4c1 (diff)
parenta877dab0bddaeb5503d871794ca06f1c81d805b8 (diff)
downloadpython-setuptools-git-5f151cbbcd6c65f7f48082bfaf36db3a55df936e.tar.gz
Merge branch 'master' into 2020-06-11-raise-from
Diffstat (limited to 'setuptools/command/build_ext.py')
-rw-r--r--setuptools/command/build_ext.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/setuptools/command/build_ext.py b/setuptools/command/build_ext.py
index 03b6f346..327fa063 100644
--- a/setuptools/command/build_ext.py
+++ b/setuptools/command/build_ext.py
@@ -254,7 +254,8 @@ class build_ext(_build_ext):
'\n'.join([
"def __bootstrap__():",
" global __bootstrap__, __file__, __loader__",
- " import sys, os, pkg_resources, imp" + if_dl(", dl"),
+ " import sys, os, pkg_resources" + if_dl(", dl"),
+ " from importlib.machinery import ExtensionFileLoader",
" __file__ = pkg_resources.resource_filename"
"(__name__,%r)"
% os.path.basename(ext._file_name),
@@ -266,7 +267,8 @@ class build_ext(_build_ext):
" try:",
" os.chdir(os.path.dirname(__file__))",
if_dl(" sys.setdlopenflags(dl.RTLD_NOW)"),
- " imp.load_dynamic(__name__,__file__)",
+ " ExtensionFileLoader(__name__,",
+ " __file__).exec_module()",
" finally:",
if_dl(" sys.setdlopenflags(old_flags)"),
" os.chdir(old_dir)",