Skip to content

Commit 7e46387

Browse files
microdev1dhalbert
andcommitted
add non-native exception in traceback_test
Co-authored-by: Dan Halbert <[email protected]>
1 parent 70b3e73 commit 7e46387

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

tests/circuitpython/traceback_test.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,15 @@ def fun():
2222
traceback.print_exception(None, exc, exc.__traceback__, limit=0)
2323
print("\nLimit=-1 Trace:")
2424
traceback.print_exception(None, exc, exc.__traceback__, limit=-1)
25+
26+
27+
class NonNativeException(Exception):
28+
pass
29+
30+
31+
try:
32+
raise NonNativeException("test")
33+
except Exception as e:
34+
print("\nNonNative Trace:")
35+
traceback.print_exception(None, e, e.__traceback__)
2536
print("")

tests/circuitpython/traceback_test.py.exp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@ Traceback (most recent call last):
2121
File "circuitpython/traceback_test.py", line 9, in fun
2222
Exception: test
2323

24+
NonNative Trace:
25+
Traceback (most recent call last):
26+
File "circuitpython/traceback_test.py", line 32, in <module>
27+
NonNativeException: test
28+

0 commit comments

Comments
 (0)