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

Skip to content

Commit 8c6e0ec

Browse files
committed
Bug #599248: strip directories when building Python. Out-of-tree builds should work again.
1 parent 4464432 commit 8c6e0ec

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Lib/distutils/ccompiler.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from distutils.file_util import move_file
1616
from distutils.dir_util import mkpath
1717
from distutils.dep_util import newer_pairwise, newer_group
18+
from distutils.sysconfig import python_build
1819
from distutils.util import split_quoted, execute
1920
from distutils import log
2021

@@ -366,7 +367,9 @@ def _setup_compile(self, outdir, macros, incdirs, sources, depends,
366367
extra = []
367368

368369
# Get the list of expected output (object) files
369-
objects = self.object_filenames(sources, 0, outdir)
370+
objects = self.object_filenames(sources,
371+
strip_dir=python_build,
372+
output_dir=outdir)
370373
assert len(objects) == len(sources)
371374

372375
# XXX should redo this code to eliminate skip_source entirely.
@@ -472,7 +475,7 @@ def _prep_compile(self, sources, output_dir, depends=None):
472475
which source files can be skipped.
473476
"""
474477
# Get the list of expected output (object) files
475-
objects = self.object_filenames(sources, strip_dir=0,
478+
objects = self.object_filenames(sources, strip_dir=python_build,
476479
output_dir=output_dir)
477480
assert len(objects) == len(sources)
478481

0 commit comments

Comments
 (0)