Skip to content

Commit

Permalink
Fix check for repeated HikariInterrupt exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
davfsa committed Nov 2, 2023
1 parent 6a8c202 commit ca99681
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hikari/internal/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ def handle_interrupts(
if propagate_interrupts:
# Always raise a new clean errors.HikariInterrupt, which is similar
# to what pure Python would do with KeyboardInterrupt
from_ex = ex if not isinstance(ex, errors.HikariInterrupt) else None
raise ex from from_ex
if type(ex.__cause__ is errors.HikariInterrupt):
raise ex from None

raise

finally:
for sig in _INTERRUPT_SIGNALS:
Expand Down

0 comments on commit ca99681

Please sign in to comment.