Linaro Git Browser
Code Review
Sign In
review.linaro.org
/
lite
/
micropython
/
539681fffd96082ca3b5d18643d4f08f65c47170
/
.
/
tests
/
basics
/
try_reraise.py
blob: bf5e77c0b03d043350e844a91870d322108eebf7 [
file
] [
log
] [
blame
]
# 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"
)