File size: 501 Bytes
60f5111
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
try:
    try:
        raise ExceptionGroup(
            "eg",
            [
                ValueError(1),
                TypeError(2),
                OSError(3),
                ExceptionGroup(
                    "nested",
                    [OSError(4), TypeError(5), ValueError(6)])
            ]
        )
    except* ValueError as e:
        print(f'*ValueError: {e!r}')
        raise
    except* OSError as e:
        print(f'*OSError: {e!r}')
except ExceptionGroup as e:
    print(repr(e))