mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Issue # 17177: Stop using imp in setup.py
This commit is contained in:
parent
e7e1deef17
commit
ca5ff3a069
1 changed files with 3 additions and 2 deletions
5
setup.py
5
setup.py
|
@ -1,7 +1,7 @@
|
||||||
# Autodetecting setup.py script for building the Python extensions
|
# Autodetecting setup.py script for building the Python extensions
|
||||||
#
|
#
|
||||||
|
|
||||||
import sys, os, imp, re, optparse
|
import sys, os, importlib.machinery, re, optparse
|
||||||
from glob import glob
|
from glob import glob
|
||||||
import sysconfig
|
import sysconfig
|
||||||
|
|
||||||
|
@ -325,8 +325,9 @@ class PyBuildExt(build_ext):
|
||||||
if cross_compiling:
|
if cross_compiling:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
loader = importlib.machinery.ExtensionFileLoader(ext.name, ext_filename)
|
||||||
try:
|
try:
|
||||||
imp.load_dynamic(ext.name, ext_filename)
|
loader.load_module()
|
||||||
except ImportError as why:
|
except ImportError as why:
|
||||||
self.failed.append(ext.name)
|
self.failed.append(ext.name)
|
||||||
self.announce('*** WARNING: renaming "%s" since importing it'
|
self.announce('*** WARNING: renaming "%s" since importing it'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue