Skip to content

Exceptions traceback is not valid #5572

@Neradoc

Description

@Neradoc

In the latest main, this code:

import traceback
try:
	print(5/0)
except Exception as ex:
	traceback.print_exception(ex, ex, ex.__traceback__)

Results in:

code.py output:
Traceback (most recent call last):
  File "code.py", line 5, in <module>
TypeError: tb must be of type traceback

While this code:

import traceback
try:
	print(5/0)
except Exception as ex:
	print(ex.__traceback__)

Just hangs, forcing a reset.
Tested on Raspberry pico. Seems to come from #5562

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions