Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 10da45e

Browse files
committed
[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.
1 parent 21012b8 commit 10da45e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Lib/distutils/ccompiler.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,8 @@ def object_filenames(self, source_filenames, strip_dir=0, output_dir=''):
932932
obj_names = []
933933
for src_name in source_filenames:
934934
base, ext = os.path.splitext(src_name)
935+
base = os.path.splitdrive(base)[1] # Chop off the drive
936+
base = base[os.path.isabs(base):] # If abs, chop off leading /
935937
if ext not in self.src_extensions:
936938
raise UnknownFileError, \
937939
"unknown file type '%s' (from '%s')" % (ext, src_name)

0 commit comments

Comments
 (0)