Serhiy Storchaka added the comment: Thank you for your patches Dmitry.
But I think that the code can be made simpler. Here is a patch which refactors extracting code. It splits the code on few generators which do different tasks: iterate over tracebacks or frames linked list, limit the size of proceeded sequence, and generates required fields. Note that the behavior of extract_stack() with negative limit differs if sys.tracebacklimit is specified and less than the length of full traceback. Tests are changed too, now they test all combinations of the limit parameter and sys.tracebacklimit. ---------- stage: -> patch review Added file: http://bugs.python.org/file37731/traceback_negative_limit_2.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22619> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com