mirror of
https://github.com/micropython/micropython.git
synced 2025-09-06 18:00:48 +02:00
The implementation is very basic and non-compliant and provided solely for CPython compatibility. The function itself is bad Python2 heritage, its usage is discouraged.
23 lines
360 B
Python
23 lines
360 B
Python
import sys
|
|
try:
|
|
sys.exc_info
|
|
except:
|
|
print("SKIP")
|
|
sys.exit()
|
|
|
|
def f():
|
|
print(sys.exc_info()[0:2])
|
|
|
|
try:
|
|
1/0
|
|
except:
|
|
print(sys.exc_info()[0:2])
|
|
f()
|
|
|
|
# MicroPython currently doesn't reset sys.exc_info() value
|
|
# on exit from "except" block.
|
|
#f()
|
|
|
|
# Recursive except blocks are not handled either - just don't
|
|
# use exc_info() at all!
|