From edc3e263693586b69a1e044b66dfdde4f5054362 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Mon, 19 Sep 2022 15:17:06 -0400 Subject: fix odd mypy issue in unreachable code This used to be fine, until imports were removed from this file. Now a function annotated as T.NoReturn doesn't actually tell mypy that it cannot return, though, so we manually do it. --- mesonbuild/compilers/detect.py | 1 + 1 file changed, 1 insertion(+) (limited to 'mesonbuild/compilers') diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py index 2fbb215..4414a57 100644 --- a/mesonbuild/compilers/detect.py +++ b/mesonbuild/compilers/detect.py @@ -240,6 +240,7 @@ def detect_static_linker(env: 'Environment', compiler: Compiler) -> StaticLinker if p.returncode == 1 and err.startswith('ar: bad option: --'): # Solaris return linkers.ArLinker(compiler.for_machine, linker) _handle_exceptions(popen_exceptions, trials, 'linker') + raise EnvironmentException('Unreachable code (exception to make mypy happy)') # Compilers -- cgit v1.1