diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-02-23 03:01:26 +0530 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-02-26 07:28:27 -0500 |
commit | 4f0e204c342aa1788b31b105c14aa7bdf914f882 (patch) | |
tree | e0b53418c662f825d2aad8b23cd5ab8b81c0aaa7 /mesonbuild | |
parent | 7cece438ccbf3c058c70e84dcc5ee702a5c3b702 (diff) | |
download | meson-4f0e204c342aa1788b31b105c14aa7bdf914f882.zip meson-4f0e204c342aa1788b31b105c14aa7bdf914f882.tar.gz meson-4f0e204c342aa1788b31b105c14aa7bdf914f882.tar.bz2 |
Fix undefined variables in ObjC/C++ detection
Pointed out by Mike Sinkovsky
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/environment.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 88dc4cf..4bdc4df 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -511,10 +511,11 @@ class Environment: for compiler in compilers: if isinstance(compiler, str): compiler = [compiler] + arg = ['--version'] try: - p, out, err = Popen_safe(compiler + ['--version']) - except OSError: - popen_exceptions[' '.join(compiler + [arg])] = e + p, out, err = Popen_safe(compiler + arg) + except OSError as e: + popen_exceptions[' '.join(compiler + arg)] = e version = search_version(out) if 'Free Software Foundation' in out: defines = self.get_gnu_compiler_defines(compiler) @@ -536,10 +537,11 @@ class Environment: for compiler in compilers: if isinstance(compiler, str): compiler = [compiler] + arg = ['--version'] try: - p, out, err = Popen_safe(compiler + ['--version']) - except OSError: - popen_exceptions[' '.join(compiler + [arg])] = e + p, out, err = Popen_safe(compiler + arg) + except OSError as e: + popen_exceptions[' '.join(compiler + arg)] = e version = search_version(out) if 'Free Software Foundation' in out: defines = self.get_gnu_compiler_defines(compiler) |