summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael W. Hudson <mwh@python.net>2002-03-01 14:16:31 (GMT)
committerMichael W. Hudson <mwh@python.net>2002-03-01 14:16:31 (GMT)
commit7113d9607bcc685fdd1d33bfed83eae92902de42 (patch)
tree8f69c1fbb07f487e8dae2441cfa6e319c57cee08
parentdcea37026eb5ee263368247940f0ee4c855f1d8a (diff)
downloadcpython-7113d9607bcc685fdd1d33bfed83eae92902de42.zip
cpython-7113d9607bcc685fdd1d33bfed83eae92902de42.tar.gz
cpython-7113d9607bcc685fdd1d33bfed83eae92902de42.tar.bz2
Changes to what we do to modules that don't import, as
discussed on python-dev.
-rw-r--r--setup.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/setup.py b/setup.py
index c467ec7..7f34c32 100644
--- a/setup.py
+++ b/setup.py
@@ -176,13 +176,13 @@ class PyBuildExt(build_ext):
except ImportError, why:
if 1:
- self.announce('*** WARNING: removing "%s" since importing it'
+ self.announce('*** WARNING: renaming "%s" since importing it'
' failed: %s' % (ext.name, why))
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)
+ basename, tail = os.path.splitext(ext_filename)
+ newname = basename + "_failed" + tail
+ if os.path.exists(newname): os.remove(newname)
+ os.rename(ext_filename, newname)
# XXX -- This relies on a Vile HACK in
# distutils.command.build_ext.build_extension(). The