micropython: add micropython component
This commit is contained in:
19
components/language/micropython/tests/basics/try_reraise.py
Normal file
19
components/language/micropython/tests/basics/try_reraise.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# 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")
|
Reference in New Issue
Block a user