aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/compilers/c.py4
-rw-r--r--mesonbuild/coredata.py2
-rw-r--r--mesonbuild/scripts/meson_install.py2
-rwxr-xr-xtest cases/common/72 build always/version_gen.py4
4 files changed, 6 insertions, 6 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)
diff --git a/test cases/common/72 build always/version_gen.py b/test cases/common/72 build always/version_gen.py
index d7b01ca..e5a0c2c 100755
--- a/test cases/common/72 build always/version_gen.py
+++ b/test cases/common/72 build always/version_gen.py
@@ -12,7 +12,7 @@ def generate(infile, outfile, fallback):
(stdo, _) = p.communicate()
if p.returncode == 0:
version = stdo.decode().strip()
- except:
+ except Exception:
pass
with open(infile) as f:
newdata = f.read().replace('@VERSION@', version)
@@ -21,7 +21,7 @@ def generate(infile, outfile, fallback):
olddata = f.read()
if olddata == newdata:
return
- except:
+ except Exception:
pass
with open(outfile, 'w') as f:
f.write(newdata)