Skip to content

Commit

Permalink
Fix system exit hang on Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Mar 24, 2024
1 parent ee53e9f commit 223bb81
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/exceptiongroup/_catch.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def __exit__(
else:
if isinstance(exc, BaseExceptionGroup):
try:
if isinstance(unhandled, SystemExit):
sys.exit(unhandled.code)
raise unhandled from exc.__cause__
except BaseExceptionGroup:
# Change __context__ to __cause__ because Python 3.11 does this
Expand Down

0 comments on commit 223bb81

Please sign in to comment.