Skip to content

Commit 03ffbcd

Browse files
committed
Fix SF # 532618 517704, install problems when building modules fail.
Fix whitespace on a line also.
1 parent 8c07722 commit 03ffbcd

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

setup.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,13 @@ def build_extension(self, ext):
188188
# distutils.command.build_ext.build_extension(). The
189189
# _built_objects attribute is stored there strictly for
190190
# use here.
191-
for filename in self._built_objects:
192-
os.remove(filename)
191+
# If there is a failure, _built_objects may not be there,
192+
# so catch the AttributeError and move on.
193+
try:
194+
for filename in self._built_objects:
195+
os.remove(filename)
196+
except AttributeError:
197+
self.announce('unable to remove files (ignored)')
193198
else:
194199
self.announce('*** WARNING: importing extension "%s" '
195200
'failed: %s' % (ext.name, why))
@@ -605,7 +610,7 @@ def detect_modules(self):
605610
# procedure triggers on.
606611
frameworkdir = sysconfig.get_config_var('PYTHONFRAMEWORKDIR')
607612
exts.append( Extension('gestalt', ['gestaltmodule.c'],
608-
extra_link_args=['-framework', 'Carbon']) )
613+
extra_link_args=['-framework', 'Carbon']) )
609614
exts.append( Extension('MacOS', ['macosmodule.c'],
610615
extra_link_args=['-framework', 'Carbon']) )
611616
exts.append( Extension('icglue', ['icgluemodule.c'],

0 commit comments

Comments
 (0)