try-reraise.py 187 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
# Re-reraising last exception with raise w/o args

def f():
    try:
        raise ValueError("val", 3)
    except:
        raise

try:
    f()
except ValueError as e:
    print(repr(e))