2014-03-29 13:44:15 -04:00
|
|
|
# Reraising last exception with raise w/o args
|
2014-03-26 08:42:17 -04:00
|
|
|
|
|
|
|
def f():
|
|
|
|
try:
|
|
|
|
raise ValueError("val", 3)
|
|
|
|
except:
|
|
|
|
raise
|
|
|
|
|
|
|
|
try:
|
|
|
|
f()
|
|
|
|
except ValueError as e:
|
|
|
|
print(repr(e))
|
2014-03-29 13:44:15 -04:00
|
|
|
|
|
|
|
|
|
|
|
# Can reraise only in except block
|
|
|
|
try:
|
|
|
|
raise
|
|
|
|
except RuntimeError:
|
|
|
|
print("RuntimeError")
|