Message414677
It skips the least recent frames:
>>> def error(): 1 / 0
...
>>> def g(): error()
...
>>> def f(): g()
...
>>> sys.tracebacklimit = 2
>>> f()
Traceback (most recent call last):
File "<stdin>", line 1, in g
File "<stdin>", line 1, in error
ZeroDivisionError: division by zero
>>> sys.tracebacklimit = 5
>>> f()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 1, in f
File "<stdin>", line 1, in g
File "<stdin>", line 1, in error
ZeroDivisionError: division by zero
(tried on current main)
I think that's the right behavior because it tells you the function that actually throws the error, which is much harder to figure out from scratch than where the call started. |
|
Date |
User |
Action |
Args |
2022-03-07 17:05:33 | JelleZijlstra | set | recipients:
+ JelleZijlstra, gvanrossum, iritkatriel |
2022-03-07 17:05:33 | JelleZijlstra | set | messageid: <1646672733.16.0.448459715427.issue46949@roundup.psfhosted.org> |
2022-03-07 17:05:33 | JelleZijlstra | link | issue46949 messages |
2022-03-07 17:05:33 | JelleZijlstra | create | |
|