Datasets:
File size: 333 Bytes
60f5111 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | try:
raise ExceptionGroup(
"eg",
[
ValueError('a'),
TypeError('b'),
ExceptionGroup(
"nested",
[TypeError('c'), KeyError('d')])
]
)
except* TypeError as e1:
print(f'e1 = {e1!r}')
except* Exception as e2:
print(f'e2 = {e2!r}')
|