mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
Fix for
[ #433775 ] module build dir first in test import though not in the way the summary would suggest; use imp.load_dynamic() in setup.py to ensure we're testing the dynamic object we think we are.
This commit is contained in:
parent
5b10910d7a
commit
af14289c54
1 changed files with 5 additions and 2 deletions
7
setup.py
7
setup.py
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
__version__ = "$Revision$"
|
__version__ = "$Revision$"
|
||||||
|
|
||||||
import sys, os, getopt
|
import sys, os, getopt, imp
|
||||||
from distutils import sysconfig
|
from distutils import sysconfig
|
||||||
from distutils import text_file
|
from distutils import text_file
|
||||||
from distutils.errors import *
|
from distutils.errors import *
|
||||||
|
@ -168,8 +168,11 @@ class PyBuildExt(build_ext):
|
||||||
'WARNING: skipping import check for Carbon-based "%s"' %
|
'WARNING: skipping import check for Carbon-based "%s"' %
|
||||||
ext.name)
|
ext.name)
|
||||||
return
|
return
|
||||||
|
ext_filename = os.path.join(
|
||||||
|
self.build_lib,
|
||||||
|
self.get_ext_filename(self.get_ext_fullname(ext.name)))
|
||||||
try:
|
try:
|
||||||
__import__(ext.name)
|
imp.load_dynamic(ext.name, ext_filename)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
self.announce('WARNING: removing "%s" since importing it failed' %
|
self.announce('WARNING: removing "%s" since importing it failed' %
|
||||||
ext.name)
|
ext.name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue