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.
pull/10011/head
Eli Schwartz 3 years ago
parent 2974f2bcb8
commit 0d6972887f
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 2
      mesonbuild/interpreter/primitives/range.py
  2. 2
      mesonbuild/wrap/wrap.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:

@ -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

Loading…
Cancel
Save