From: Michael W. Hudson Date: Mon, 25 Mar 2002 13:59:28 +0000 (+0000) Subject: nnorwitz's fix for: X-Git-Tag: v2.2.1c2~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7ab5923df5803fb08f809ceda98505594a907288;p=thirdparty%2FPython%2Fcpython.git nnorwitz's fix for: [ 532618 ] install fails if build .so fails --- diff --git a/setup.py b/setup.py index 762bbeeef03b..4b7b0c63834e 100644 --- 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'],