From 10da45e2371b6e44b32105cf8a1cdb655e173ca2 Mon Sep 17 00:00:00 2001 From: "Andrew M. Kuchling" Date: Wed, 26 Feb 2003 18:52:07 +0000 Subject: [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. --- Lib/distutils/ccompiler.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Lib/distutils/ccompiler.py') diff --git a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py index bfcf1279f1..46fb743db0 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) -- cgit v1.2.1