aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorAleksey Filippov <alekseyf@google.com>2018-03-09 01:20:26 +0000
committerAleksey Filippov <alekseyf@google.com>2018-03-11 23:36:04 +0000
commite4faf396e62813665e44fc742e7f355ad532f4d2 (patch)
tree8976409cd8eb35d862270d0cc90217b96109af6e /mesonbuild
parentd977b78f1b6f95a6eab3da8a6d7d9ad06d8b80fd (diff)
downloadmeson-e4faf396e62813665e44fc742e7f355ad532f4d2.zip
meson-e4faf396e62813665e44fc742e7f355ad532f4d2.tar.gz
meson-e4faf396e62813665e44fc742e7f355ad532f4d2.tar.bz2
Do not use bare except [flake8]
Use more specific exception types where appropriate. This patch does not change bare except calls if exception is re-raised.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/compilers/c.py4
-rw-r--r--mesonbuild/coredata.py2
-rw-r--r--mesonbuild/scripts/meson_install.py2
3 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index 1c9b9b4..2d14116 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -525,7 +525,7 @@ class CCompiler(Compiler):
elif rtype == 'int':
try:
return int(res.stdout.strip())
- except:
+ except ValueError:
m = 'Return value of {}() is not an int'
raise EnvironmentException(m.format(fname))
@@ -1140,7 +1140,7 @@ class VisualStudioCCompiler(CCompiler):
# See boost/config/compiler/visualc.cpp for up to date mapping
try:
version = int(''.join(self.version.split('.')[0:2]))
- except:
+ except ValueError:
return None
if version < 1310:
return '7.0'
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index e2a0b48..993effc 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -111,7 +111,7 @@ class UserIntegerOption(UserOption):
def toint(self, valuestring):
try:
return int(valuestring)
- except:
+ except ValueError:
raise MesonException('Value string "%s" is not convertable to an integer.' % valuestring)
def validate_value(self, value):
diff --git a/mesonbuild/scripts/meson_install.py b/mesonbuild/scripts/meson_install.py
index cbc782d..2a23f81 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:
+ except Exception:
print('Failed to run install script {!r}'.format(name))
sys.exit(1)