]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
nnorwitz's fix for:
authorMichael W. Hudson <mwh@python.net>
Mon, 25 Mar 2002 13:59:28 +0000 (13:59 +0000)
committerMichael W. Hudson <mwh@python.net>
Mon, 25 Mar 2002 13:59:28 +0000 (13:59 +0000)
[ 532618 ] install fails if build .so fails

setup.py

index 762bbeeef03b2c741dffbb7648975e3205aa7d67..4b7b0c63834ef0fb58ca789a1be4138fe620cabe 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -176,8 +176,13 @@ class PyBuildExt(build_ext):
             # distutils.command.build_ext.build_extension().  The
             # _built_objects attribute is stored there strictly for
             # use here.
-            for filename in self._built_objects:
-                os.remove(filename)
+            # If there is a failure, _built_objects may not be there,
+            # so catch the AttributeError and move on.
+            try:
+                for filename in self._built_objects:
+                    os.remove(filename)
+            except AttributeError:
+                self.announce('unable to remove files (ignored)')
 
     def get_platform (self):
         # Get value of sys.platform
@@ -587,7 +592,7 @@ class PyBuildExt(build_ext):
             # procedure triggers on.
             frameworkdir = sysconfig.get_config_var('PYTHONFRAMEWORKDIR')
             exts.append( Extension('gestalt', ['gestaltmodule.c'],
-                       extra_link_args=['-framework', 'Carbon']) )
+                        extra_link_args=['-framework', 'Carbon']) )
             exts.append( Extension('MacOS', ['macosmodule.c'],
                         extra_link_args=['-framework', 'Carbon']) )
             exts.append( Extension('icglue', ['icgluemodule.c'],