circuitpython/tests/basics/try_reraise.py
Damien George 539681fffd tests: Rename test scripts, changing - to _ for consistency.
From now on, all new tests must use underscore.

Addresses issue #727.
2014-07-05 06:14:29 +01:00

20 lines
283 B
Python

# 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))
# Can reraise only in except block
try:
raise
except RuntimeError:
print("RuntimeError")