Skip to content

Commit 42dfd06

Browse files
authored
Merge pull request #339 from Sachaa-Thanasius/fix-annotation
Widen return type of `CCompiler.runtime_library_dir_option()`.
2 parents 08149a8 + c3b1afa commit 42dfd06

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

distutils/compilers/C/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ def library_dir_option(self, dir: str) -> str:
865865
"""
866866
raise NotImplementedError
867867

868-
def runtime_library_dir_option(self, dir: str) -> str:
868+
def runtime_library_dir_option(self, dir: str) -> str | list[str]:
869869
"""Return the compiler option to add 'dir' to the list of
870870
directories searched for runtime libraries.
871871
"""

distutils/compilers/C/unix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def _is_gcc(self):
322322
compiler = os.path.basename(shlex.split(cc_var)[0])
323323
return "gcc" in compiler or "g++" in compiler
324324

325-
def runtime_library_dir_option(self, dir: str) -> str | list[str]: # type: ignore[override] # Fixed in pypa/distutils#339
325+
def runtime_library_dir_option(self, dir: str) -> str | list[str]:
326326
# XXX Hackish, at the very least. See Python bug #445902:
327327
# https://bugs.python.org/issue445902
328328
# Linkers on different platforms need different options to

newsfragments/4902.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Reverted distutils changes that broke the monkey patching of command classes.

0 commit comments

Comments
 (0)