LLVM Backend (original) (raw)

class MyGroup(ExceptionGroup): def derive(self, excs): return MyGroup(self.message, excs)

e = MyGroup("eg", [ValueError(1), TypeError(2)]) e.add_note("a note") e.context = Exception("context") e.cause = Exception("cause") try: raise e except Exception as e: exc = e

match, rest = exc.split(ValueError) exc, exc.context, exc.cause, exc.notes

match, match.context, match.cause, match.notes

rest, rest.context, rest.cause, rest.notes

exc.traceback is match.traceback is rest.traceback