From f37692bedb6c6a68fe1a1b91722fcb0b809e9fde Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Fri, 9 Feb 2018 15:46:13 +0000 Subject: Fix exception in 'test cases/failing/55 wrong shared crate type' when rustc is missing Fix exception handling of missing rustc, by making it look like the other compiler detectors Traceback (most recent call last): File "/wip/meson/mesonbuild/environment.py", line 699, in detect_rust_compiler p, out = Popen_safe(compiler + ['--version'])[0:2] [...] FileNotFoundError: [Errno 2] No such file or directory: 'rustc': 'rustc' During handling of the above exception, another exception occurred: [...] File "/wip/meson/mesonbuild/environment.py", line 701, in detect_rust_compiler popen_exceptions[compiler] = e TypeError: unhashable type: 'list' --- mesonbuild/environment.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mesonbuild/environment.py') diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 52c670a..e553423 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -695,10 +695,11 @@ class Environment: for compiler in compilers: if isinstance(compiler, str): compiler = [compiler] + arg = ['--version'] try: - p, out = Popen_safe(compiler + ['--version'])[0:2] + p, out = Popen_safe(compiler + arg)[0:2] except OSError as e: - popen_exceptions[compiler] = e + popen_exceptions[' '.join(compiler + arg)] = e continue version = search_version(out) -- cgit v1.1