summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2001-05-21 20:48:09 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2001-05-21 20:48:09 (GMT)
commit62686696123eb82df5f688b9a3906b9b648ce220 (patch)
treea17511aba3a17fa1f947dd56986eb22a824705d3 /setup.py
parent185bd6fc7643086c0de1314f0b65483093ecd785 (diff)
downloadcpython-62686696123eb82df5f688b9a3906b9b648ce220.zip
cpython-62686696123eb82df5f688b9a3906b9b648ce220.tar.gz
cpython-62686696123eb82df5f688b9a3906b9b648ce220.tar.bz2
Patch #411055 from MvL: import each extension after building it, and
delete ones that can't be imported due to missing symbols or other causes.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index f544ee5..5c5f5dc 100644
--- a/setup.py
+++ b/setup.py
@@ -130,6 +130,17 @@ class PyBuildExt(build_ext):
except (CCompilerError, DistutilsError), why:
self.announce('WARNING: building of extension "%s" failed: %s' %
(ext.name, sys.exc_info()[1]))
+ return
+ try:
+ __import__(ext.name)
+ except ImportError:
+ self.announce('WARNING: removing "%s" since importing it failed' %
+ ext.name)
+ assert not self.inplace
+ fullname = self.get_ext_fullname(ext.name)
+ ext_filename = os.path.join(self.build_lib,
+ self.get_ext_filename(fullname))
+ os.remove(ext_filename)
def get_platform (self):
# Get value of sys.platform
@@ -602,6 +613,9 @@ class PyBuildInstall(install):
self.warn_dir=0
def main():
+ # turn off warnings when deprecated modules are imported
+ import warnings
+ warnings.filterwarnings("ignore",category=DeprecationWarning)
setup(name = 'Python standard library',
version = '%d.%d' % sys.version_info[:2],
cmdclass = {'build_ext':PyBuildExt, 'install':PyBuildInstall},