aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-02-16 19:52:37 -0500
committerEli Schwartz <eschwartz@archlinux.org>2022-02-16 23:00:31 -0500
commit0d6972887f1b7d39524c5faff0b3c8612b5d0ece (patch)
tree7d9c231e4f1c9130c212aa289f92e7061f28473f /mesonbuild
parent2974f2bcb836fc8ff7eafaa1a1d371efbc025c0f (diff)
downloadmeson-0d6972887f1b7d39524c5faff0b3c8612b5d0ece.zip
meson-0d6972887f1b7d39524c5faff0b3c8612b5d0ece.tar.gz
meson-0d6972887f1b7d39524c5faff0b3c8612b5d0ece.tar.bz2
flake8: do not use bare exceptions
In one case, we actually specifically want to catch IndexError only. In the other case, excepting Exception rather than BaseException is quite fine.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/interpreter/primitives/range.py2
-rw-r--r--mesonbuild/wrap/wrap.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/interpreter/primitives/range.py b/mesonbuild/interpreter/primitives/range.py
index a35470c..dd99205 100644
--- a/mesonbuild/interpreter/primitives/range.py
+++ b/mesonbuild/interpreter/primitives/range.py
@@ -24,7 +24,7 @@ class RangeHolder(MesonInterpreterObject, IterableObject):
def op_index(self, other: int) -> int:
try:
return self.range[other]
- except:
+ except IndexError:
raise InvalidArguments(f'Index {other} out of bounds of range.')
def iter_tuple_size(self) -> None:
diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py
index 51632fd..62ccc14 100644
--- a/mesonbuild/wrap/wrap.py
+++ b/mesonbuild/wrap/wrap.py
@@ -349,7 +349,7 @@ class Resolver:
raise WrapException(f'Unknown wrap type {self.wrap.type!r}')
try:
self.apply_patch()
- except:
+ except Exception:
windows_proof_rmtree(self.dirname)
raise