You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
raise_single_exception_from_group was introduced as part of #3240 and #3197, but handles KeyboardInterrupt and SystemExit by wrapping the original exception in an exception of the same type:
# immediately bail out if there's any KI or SystemExitforeineg.exceptions:
ifisinstance(e, (KeyboardInterrupt, SystemExit)):
raisetype(e) fromeg
Notably, this causes the resulting SystemExit to have no exit status, so system.exit(1) (or really any other exit status) does not properly set the exit status. I do not see a good reason why the exception should not be raised directly:
# immediately bail out if there's any KI or SystemExitforeineg.exceptions:
ifisinstance(e, (KeyboardInterrupt, SystemExit)):
raiseefromeg