try-as-var.py 180 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
try:
    raise ValueError(534)
except ValueError as e:
    print(repr(e))

# Var bound in except block is automatically deleted
try:
    e
except NameError:
    print("NameError")