changeset: 92664:94af1af93670 parent: 92657:6e7d923dfd2a user: Antoine Pitrou date: Tue Sep 30 14:58:22 2014 +0200 files: Lib/distutils/command/build_ext.py setup.py description: Remove pointless "vile hack" that can cause the build step to fail when some extension modules can't be imported. See issue #5309 for the build failures, issue #458343 for the original motivation. diff -r 6e7d923dfd2a -r 94af1af93670 Lib/distutils/command/build_ext.py --- a/Lib/distutils/command/build_ext.py Tue Sep 30 13:55:30 2014 +0200 +++ b/Lib/distutils/command/build_ext.py Tue Sep 30 14:58:22 2014 +0200 @@ -545,15 +545,8 @@ extra_postargs=extra_args, depends=ext.depends) - # XXX -- this is a Vile HACK! - # - # The setup.py script for Python on Unix needs to be able to - # get this list so it can perform all the clean up needed to - # avoid keeping object files around when cleaning out a failed - # build of an extension module. Since Distutils does not - # track dependencies, we have to get rid of intermediates to - # ensure all the intermediates will be properly re-built. - # + # XXX outdated variable, kept here in case third-part code + # needs it. self._built_objects = objects[:] # Now link the object files together into a "shared object" -- diff -r 6e7d923dfd2a -r 94af1af93670 setup.py --- a/setup.py Tue Sep 30 13:55:30 2014 +0200 +++ b/setup.py Tue Sep 30 14:58:22 2014 +0200 @@ -381,17 +381,6 @@ os.remove(newname) os.rename(ext_filename, newname) - # XXX -- This relies on a Vile HACK in - # distutils.command.build_ext.build_extension(). The - # _built_objects attribute is stored there strictly for - # use here. - # 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)') except: exc_type, why, tb = sys.exc_info() self.announce('*** WARNING: importing extension "%s" '