Skip to content

Commit

Permalink
fix: don't decorate non-Exception subclasses (#2587)
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 authored Jul 19, 2023
1 parent b0349df commit d3e494a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/awkward/_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ def __enter__(self):
def __exit__(self, exception_type, exception_value, traceback):
try:
# Handle caught exception
if exception_type is not None and self.primary() is self:
if (
exception_type is not None
and issubclass(exception_type, Exception)
and self.primary() is self
):
self.handle_exception(exception_type, exception_value)
finally:
# `_kwargs` may hold cyclic references, that we really want to avoid
Expand Down

0 comments on commit d3e494a

Please sign in to comment.