Emanuel Barry added the comment:

Thank you Nick for the comments! Updated patch attached.

The new patch uses inspect.stack() to calculate the total stack size, but I'm 
unable to get the exact number needed, and I found that I'm either 19 or 20 
above (depending on whether I run it with -m or manually). The test now "just 
works" with it, but I'm quite sure it's going to break at some point. Any idea?

The other alternative would be to use traceback.walk_tb(exc.__traceback__), but 
the Python implementation uses that, so it'd be comparing itself; and that's 
about as useful as not caring about the size at all. (On the other hand, the C 
and Python implementations get the exact same number, so it can confirm it's 
fine)

----------
stage: commit review -> patch review
Added file: http://bugs.python.org/file43863/short_tracebacks_6.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26823>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to