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