Skip to content

Commit 33de6fe

Browse files
Apply ruff/tryceratops rule TRY201
Use `raise` without specifying exception name
1 parent 7fa622e commit 33de6fe

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/blosc2/lazyexpr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def ne_evaluate(expression, local_dict=None, **kwargs):
114114
if e.args and e.args[0] == "NumExpr 2 does not support Unicode as a dtype.":
115115
pass
116116
else:
117-
raise e # unsafe expression
117+
raise # unsafe expression
118118
except Exception:
119119
pass
120120
# Try with blosc2 funcs as presence of non-numexpr funcs probably caused failure

tests/ndarray/test_elementwise_funcs.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def _test_unary_func_impl(np_func, blosc_func, dtype, shape, chunkshape):
105105
):
106106
assert True
107107
else:
108-
raise e
108+
raise
109109

110110

111111
def _test_binary_func_proxy(np_func, blosc_func, dtype, shape, chunkshape, xp):
@@ -168,12 +168,12 @@ def _test_binary_func_proxy(np_func, blosc_func, dtype, shape, chunkshape, xp):
168168
): # not supported for complex dtypes
169169
assert True
170170
else:
171-
raise e
171+
raise
172172
except NotImplementedError as e:
173173
if np_func.__name__ in ("left_shift", "right_shift", "floor_divide", "power", "remainder"):
174174
assert True
175175
else:
176-
raise e
176+
raise
177177
except AssertionError as e:
178178
if np_func.__name__ == "power" and blosc2.isdtype(
179179
dtype, "integral"
@@ -189,7 +189,7 @@ def _test_binary_func_proxy(np_func, blosc_func, dtype, shape, chunkshape, xp):
189189
)
190190
pytest.skip("minimum and maximum for numexpr do not match NaN behaviour for numpy")
191191
else:
192-
raise e
192+
raise
193193

194194

195195
def _test_unary_func_proxy(np_func, blosc_func, dtype, shape, xp):
@@ -228,7 +228,7 @@ def _test_unary_func_proxy(np_func, blosc_func, dtype, shape, xp):
228228
):
229229
assert True
230230
else:
231-
raise e
231+
raise
232232

233233

234234
def _test_binary_func_impl(np_func, blosc_func, dtype, shape, chunkshape):
@@ -283,12 +283,12 @@ def _test_binary_func_impl(np_func, blosc_func, dtype, shape, chunkshape):
283283
): # not supported for complex dtypes
284284
assert True
285285
else:
286-
raise e
286+
raise
287287
except NotImplementedError as e:
288288
if np_func.__name__ in ("left_shift", "right_shift", "floor_divide", "power", "remainder"):
289289
assert True
290290
else:
291-
raise e
291+
raise
292292
except AssertionError as e:
293293
if np_func.__name__ == "power" and blosc2.isdtype(
294294
dtype, "integral"
@@ -304,7 +304,7 @@ def _test_binary_func_impl(np_func, blosc_func, dtype, shape, chunkshape):
304304
)
305305
pytest.skip("minimum and maximum for numexpr do not match NaN behaviour for numpy")
306306
else:
307-
raise e
307+
raise
308308

309309

310310
@pytest.mark.parametrize(("np_func", "blosc_func"), UNARY_FUNC_PAIRS)

tests/ndarray/test_reductions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def test_reduce_expr_arr(array_fixture, axis, reduce_op):
219219
print(blosccumsumVsnpsum, npcumsumVsnpsum)
220220
if blosccumsumVsnpsum < npcumsumVsnpsum:
221221
return
222-
raise e
222+
raise
223223

224224

225225
# Test broadcasting

0 commit comments

Comments
 (0)