From 886836a69bab1e0af8942d3f86171c462a802ff4 Mon Sep 17 00:00:00 2001 From: "William D. Jones" Date: Sat, 16 Mar 2024 19:28:53 -0400 Subject: Don't sanitize a None path when checking for, but could not find, unsupported cl clones. --- mesonbuild/compilers/detect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py index aed033918..dade20402 100644 --- a/mesonbuild/compilers/detect.py +++ b/mesonbuild/compilers/detect.py @@ -287,8 +287,8 @@ def _detect_c_or_cpp_compiler(env: 'Environment', lang: str, for_machine: Machin # practice, Meson will block waiting for Watcom's cl.exe to # exit, which requires user input and thus will never exit. if 'WATCOM' in os.environ: - def sanitize(p: str) -> str: - return os.path.normcase(os.path.abspath(p)) + def sanitize(p: T.Optional[str]) -> T.Optional[str]: + return os.path.normcase(os.path.abspath(p)) if p else None watcom_cls = [sanitize(os.path.join(os.environ['WATCOM'], 'BINNT', 'cl')), sanitize(os.path.join(os.environ['WATCOM'], 'BINNT', 'cl.exe')), -- cgit v1.2.3