summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2003-02-26 18:52:07 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2003-02-26 18:52:07 (GMT)
commit10da45e2371b6e44b32105cf8a1cdb655e173ca2 (patch)
tree2a83673b639300d32f16c5b82b49fbd57305d210 /Lib
parent21012b82355b9a3ad09208d0fb9e3f08de6b2ad3 (diff)
downloadcpython-10da45e2371b6e44b32105cf8a1cdb655e173ca2.zip
cpython-10da45e2371b6e44b32105cf8a1cdb655e173ca2.tar.gz
cpython-10da45e2371b6e44b32105cf8a1cdb655e173ca2.tar.bz2
[Bug #668662] Patch from Pearu Pearson: if a C source file is
specified with an absolute path, the object file is also written to an absolute path. The patch drops the drive and leading '/' from the source path, so a path like /path/to/foo.c results in an object file like build/temp.i686linux/path/to/foo.o.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/distutils/ccompiler.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py
index bfcf127..46fb743 100644
--- a/Lib/distutils/ccompiler.py
+++ b/Lib/distutils/ccompiler.py
@@ -932,6 +932,8 @@ class CCompiler:
obj_names = []
for src_name in source_filenames:
base, ext = os.path.splitext(src_name)
+ base = os.path.splitdrive(base)[1] # Chop off the drive
+ base = base[os.path.isabs(base):] # If abs, chop off leading /
if ext not in self.src_extensions:
raise UnknownFileError, \
"unknown file type '%s' (from '%s')" % (ext, src_name)