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
'module' object has no attribute 'exc_info'
sys.exc_info doesn't seem to be implemented yet, but sys.print_exception was already exist.
I think it won't be too difficult to open the exc_info interface based on the implementation of sys.print_exception, but it will be useful for logging and troubleshooting.
some module like traceback and logging need this interface to work normally.
Hope you can adopt my suggestion.
Tks!
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!