ruff: enable B warnings (mainly suppressed exceptions and unused variables)

This commit is contained in:
Dima Gerasimov 2024-08-28 01:13:18 +01:00 committed by karlicoss
parent d0df8e8f2d
commit 72cc8ff3ac
30 changed files with 83 additions and 67 deletions

View file

@ -72,7 +72,7 @@ def locate_function(module_name: str, function_name: str) -> Callable[[], Iterab
if func is not None and callable(func):
return func
except Exception as e:
raise QueryException(str(e))
raise QueryException(str(e)) # noqa: B904
raise QueryException(f"Could not find function '{function_name}' in '{module_name}'")
@ -468,7 +468,7 @@ Will attempt to call iter() on the value""")
try:
itr: Iterator[ET] = iter(it)
except TypeError as t:
raise QueryException("Could not convert input src to an Iterator: " + str(t))
raise QueryException("Could not convert input src to an Iterator: " + str(t)) # noqa: B904
# if both drop_exceptions and drop_exceptions are provided for some reason,
# should raise exceptions before dropping them