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
classMyEG(ExceptionGroup):
"""Holds BaseExceptions without itself being a BaseException."""oops=MyEG("oops", [KeyboardInterrupt()])
assertisinstance(oops, Exception)
assertnotisinstance(oops.exceptions[0], Exception)
I believe that this is a bug tracing to the period when PEP-654 did not intend (Base)ExceptionGroup to be usable as a parent class; and I think a sufficient fix would be to replace the type-equality check with an isinstance check in:
I believe that this is a bug tracing to the period when PEP-654 did not intend
(Base)ExceptionGroupto be usable as a parent class; and I think a sufficient fix would be to replace the type-equality check with an isinstance check in:cpython/Objects/exceptions.c
Lines 740 to 744 in bc390dd
cc @iritkatriel; raised via agronholm/exceptiongroup#40 (comment)
Linked PRs