[issue17646] traceback.py has a lot of code duplication

2013-04-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 84cef4f1999a by Benjamin Peterson in branch 'default': refactor traceback.py to reduce code duplication (closes #17646) http://hg.python.org/cpython/rev/84cef4f1999a -- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected st

[issue17646] traceback.py has a lot of code duplication

2013-04-22 Thread Martin Morrison
Martin Morrison added the comment: Attached another diff, which includes new test cases to cover all functions that weren't covered before - expect print_last. I couldn't see a way of getting sys.last_* set to test that function (it seems to require an "unhandled exception"). However, the func

[issue17646] traceback.py has a lot of code duplication

2013-04-20 Thread Martin Morrison
Martin Morrison added the comment: On 20 Apr 2013, at 18:55, Serhiy Storchaka wrote: > Serhiy Storchaka added the comment: > > Could print_exception() in Lib/idlelib/run.py reuse new traceback functions? Actually, cleaning up code like that in Idle and the code module and import.c was what I

[issue17646] traceback.py has a lot of code duplication

2013-04-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could print_exception() in Lib/idlelib/run.py reuse new traceback functions? -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue17646] traceback.py has a lot of code duplication

2013-04-20 Thread Martin Morrison
Martin Morrison added the comment: On 20/04/2013 03:54, Benjamin Peterson wrote: > It would be great to have a test for that. :) I was afraid you'd say that. ;-) I'll look at adding test cases to cover the functions not currently covered (seems most of the print functions aren't, and all of the

[issue17646] traceback.py has a lot of code duplication

2013-04-19 Thread Benjamin Peterson
Benjamin Peterson added the comment: It would be great to have a test for that. :) -- ___ Python tracker ___ ___ Python-bugs-list mail

[issue17646] traceback.py has a lot of code duplication

2013-04-19 Thread Martin Morrison
Martin Morrison added the comment: print_tb() wasn't passing the file argument through to print_list() - now fixed. I also verified none of the other functions had a similar bug. -- Added file: http://bugs.python.org/file29944/issue17646-4.diff ___ P

[issue17646] traceback.py has a lot of code duplication

2013-04-19 Thread Benjamin Peterson
Benjamin Peterson added the comment: Also, this patch seems to break test_zipimport. -- ___ Python tracker ___ ___ Python-bugs-list ma

[issue17646] traceback.py has a lot of code duplication

2013-04-19 Thread Martin Morrison
Martin Morrison added the comment: How embarrassing - I guess that'll teach me to try to doctor the diff file. :-) I've now regenerated the diff, and re-run all the testing, etc. Apologies for the churn. -- Added file: http://bugs.python.org/file29943/issue17646-3.diff ___

[issue17646] traceback.py has a lot of code duplication

2013-04-18 Thread Benjamin Peterson
Benjamin Peterson added the comment: patching file Lib/traceback.py patch: malformed patch at line 94: @@ -50,25 +90,7 @@ -- ___ Python tracker ___ _

[issue17646] traceback.py has a lot of code duplication

2013-04-18 Thread Martin Morrison
Martin Morrison added the comment: Sorry, that is an unrelated change I was experimenting with, which I accidentally forgot to take out. Please see the new uploaded diff. -- Added file: http://bugs.python.org/file29933/issue17646-2.diff ___ Python t

[issue17646] traceback.py has a lot of code duplication

2013-04-18 Thread Martin Morrison
Changes by Martin Morrison : Removed file: http://bugs.python.org/file29929/issue17646-2.diff ___ Python tracker ___ ___ Python-bugs-list mail

[issue17646] traceback.py has a lot of code duplication

2013-04-18 Thread Benjamin Peterson
Benjamin Peterson added the comment: What's this "f_invisible" thing? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue17646] traceback.py has a lot of code duplication

2013-04-18 Thread Martin Morrison
Martin Morrison added the comment: Latest upload has all of the agreed markups from the review. -- Added file: http://bugs.python.org/file29929/issue17646-2.diff ___ Python tracker _

[issue17646] traceback.py has a lot of code duplication

2013-04-18 Thread Benjamin Peterson
Benjamin Peterson added the comment: Okay. Will you upload the latest version? -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue17646] traceback.py has a lot of code duplication

2013-04-16 Thread Benjamin Peterson
Benjamin Peterson added the comment: The other patch author hasn't updated his patch, so this issue can just superseded the other one. I uploaded a few review comments. -- ___ Python tracker _

[issue17646] traceback.py has a lot of code duplication

2013-04-06 Thread Martin Morrison
Martin Morrison added the comment: I hadn't spotted that one! My refactor goes further (consolidates all duplicates, not just the tb ones), is implemented the way you suggested therein (print in terms of extract), and is "more efficient" in that it uses generators for all intermediate iterator

[issue17646] traceback.py has a lot of code duplication

2013-04-06 Thread Benjamin Peterson
Benjamin Peterson added the comment: How much does this overlap with #17491? -- nosy: +benjamin.peterson ___ Python tracker ___ ___ Py

[issue17646] traceback.py has a lot of code duplication

2013-04-06 Thread R. David Murray
Changes by R. David Murray : -- nosy: +r.david.murray ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue17646] traceback.py has a lot of code duplication

2013-04-06 Thread Martin Morrison
New submission from Martin Morrison: traceback.py contains a lot of code duplication, which makes it fragile in the face of changes (i.e. special cases) to the stack/traceback output (I am separately working on just such a change). The attached patch refactors the code to reduce to a single fu