diff --git a/mesonbuild/scripts/meson_install.py b/mesonbuild/scripts/meson_install.py index 2a23f8161..f895f17d6 100644 --- a/mesonbuild/scripts/meson_install.py +++ b/mesonbuild/scripts/meson_install.py @@ -283,7 +283,7 @@ def run_install_script(d): rc = subprocess.call(script + args, env=child_env) if rc != 0: sys.exit(rc) - except Exception: + except OSError: print('Failed to run install script {!r}'.format(name)) sys.exit(1) diff --git a/test cases/common/72 build always/version_gen.py b/test cases/common/72 build always/version_gen.py index 17e613e1c..fbe2df93f 100755 --- a/test cases/common/72 build always/version_gen.py +++ b/test cases/common/72 build always/version_gen.py @@ -8,7 +8,7 @@ def generate(infile, outfile, fallback): workdir = '.' try: version = subprocess.check_output(['git', 'describe'], cwd=workdir).decode().strip() - except Exception: + except (subprocess.CalledProcessError, OSError, UnicodeDecodeError): version = fallback with open(infile) as f: newdata = f.read().replace('@VERSION@', version) @@ -17,7 +17,7 @@ def generate(infile, outfile, fallback): olddata = f.read() if olddata == newdata: return - except Exception: + except OSError: pass with open(outfile, 'w') as f: f.write(newdata)