mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
[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.
This commit is contained in:
parent
21012b8235
commit
10da45e237
1 changed files with 2 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue