aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-11-23 14:19:53 +0530
committerJussi Pakkanen <jpakkane@gmail.com>2016-11-26 12:56:08 -0500
commit09fd24ea78876924c16d9d029f4ade6d53e85c8b (patch)
tree2fc8c1f5b93002da5026145beb7cbc1e92c668cb /mesonbuild/environment.py
parentac56f8d8fbe5035a1aeec93e7dd1b8b67c6643a4 (diff)
downloadmeson-09fd24ea78876924c16d9d029f4ade6d53e85c8b.zip
meson-09fd24ea78876924c16d9d029f4ade6d53e85c8b.tar.gz
meson-09fd24ea78876924c16d9d029f4ade6d53e85c8b.tar.bz2
Always catch PermissionError while looking for Ninja
Also convert a few other generic `except Exception`s to be more specific Closes #1088
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index cc62010..098f8ca 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -43,7 +43,8 @@ def detect_ninja():
for n in ['ninja', 'ninja-build']:
try:
p = subprocess.Popen([n, '--version'], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
- except FileNotFoundError:
+ except (FileNotFoundError, PermissionError):
+ # Doesn't exist in PATH or isn't executable
continue
version = p.communicate()[0].decode(errors='ignore')
# Perhaps we should add a way for the caller to know the failure mode