summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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},