Skip to content

Commit

Permalink
Remove _msvccompiler._make_out_path.
Browse files Browse the repository at this point in the history
The function is almost entirely redundant to the implementation in the parent class. The only difference is the order in which `strip_dir` is processed, but even there, it doesn't appear as if `strip_dir` is ever True, so take the risk and consolidate behavior.
  • Loading branch information
jaraco committed Aug 21, 2022
1 parent a55e73f commit 1e89985
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions distutils/_msvccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,23 +328,6 @@ def out_extensions(self):
},
}

def _make_out_path(self, output_dir, strip_dir, src_name):
base, ext = os.path.splitext(src_name)
if strip_dir:
base = os.path.basename(base)
else:
base = self._make_relative(base)
try:
# XXX: This may produce absurdly long paths. We should check
# the length of the result and trim base until we fit within
# 260 characters.
return os.path.join(output_dir, base + self.out_extensions[ext])
except LookupError:
# Better to raise an exception instead of silently continuing
# and later complain about sources and targets having
# different lengths
raise CompileError(f"Don't know how to compile {src_name}")

def compile( # noqa: C901
self,
sources,
Expand Down

0 comments on commit 1e89985

Please sign in to comment.