[Python-checkins] CVS: python/dist/src setup.py,1.40,1.41

A.M. Kuchling akuchling@users.sourceforge.net
Mon, 21 May 2001 13:48:11 -0700


Update of /cvsroot/python/python/dist/src
In directory usw-pr-cvs1:/tmp/cvs-serv11510

Modified Files:
	setup.py 
Log Message:
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.


Index: setup.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/setup.py,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -r1.40 -r1.41
*** setup.py	2001/05/21 20:44:48	1.40
--- setup.py	2001/05/21 20:48:09	1.41
***************
*** 131,134 ****
--- 131,145 ----
              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):
***************
*** 603,606 ****
--- 614,620 ----
      
  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],