From 1e89985cf5974fb59f26d0b2e0974484b165a70f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 21 Aug 2022 14:40:36 -0400 Subject: [PATCH] Remove _msvccompiler._make_out_path. 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. --- distutils/_msvccompiler.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/distutils/_msvccompiler.py b/distutils/_msvccompiler.py index 3da23ede..729c2dd5 100644 --- a/distutils/_msvccompiler.py +++ b/distutils/_msvccompiler.py @@ -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,