From a04913a51327c64f807e85119fd750485bbceb0a Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 13 Apr 2024 13:33:48 -0400 Subject: [PATCH] Add type declaration for runtime_library_dir_option, making explicit the different return types one might expect. --- distutils/unixccompiler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/distutils/unixccompiler.py b/distutils/unixccompiler.py index caf4cd33..a54481c0 100644 --- a/distutils/unixccompiler.py +++ b/distutils/unixccompiler.py @@ -13,6 +13,8 @@ * link shared library handled by 'cc -shared' """ +from __future__ import annotations + import itertools import os import re @@ -281,7 +283,7 @@ def _is_gcc(self): compiler = os.path.basename(shlex.split(cc_var)[0]) return "gcc" in compiler or "g++" in compiler - def runtime_library_dir_option(self, dir): + def runtime_library_dir_option(self, dir: str) -> str | list[str]: # XXX Hackish, at the very least. See Python bug #445902: # https://bugs.python.org/issue445902 # Linkers on different platforms need different options to