QUERY · ISSUE
traceback.format_exc failed due to sys.exc_info not exist
Is this expected? not design to work on MCU ports ?
>>> try:
... 1/0
... except:
... print(traceback.format_exc())
...
...
...
Traceback (most recent call last):
File "<stdin>", line 5, in <module>
File "traceback.py", line 27, in format_exc
AttributeError: 'module' object has no attribute 'exc_info'
CANDIDATE · ISSUE
Availability of sys.exc_info() in current builds
Dear @pfalcon and the MicroPython community,
we recently received a pyboard-D and upgraded the firmware to the latest release so we are now running
MicroPython v1.11-312-g22099ab88 on 2019-09-15; PYBD-SF2W with STM32F722IEK
We are now aiming at porting our datalogger program [1] from Pycom MicroPython to the latest Genuine MicroPython coming from your pen.
However, we are having hard times figuring out why MicroPython croaks on this code
>>> import sys
>>> sys.exc_info()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'exc_info'
Does MicroPython just doesn't support sys.exc_info() at all or did we miss something differently?
Thanks in advance for taking the time to look at this issue.
With kind regards,
Andreas.
[1] https://github.com/hiveeyes/hiveeyes-micropython-firmware
I'm not sure, I haven't tried the traceback module from here it might be out of date.
Take a look at this, it might be what you want: https://docs.micropython.org/en/latest/library/sys.html#sys.print_exception
Thanks to @andrewleech, the above link worked!