Make recursive pdb properly invoke IPython's enhanced pdb#10721
Make recursive pdb properly invoke IPython's enhanced pdb#10721Carreau merged 1 commit intoipython:masterfrom
Conversation
|
Thanks! I've milestoned it for 6.2 as a new feature, so the Like Fernando back in 2012, I had no idea that recursive pdb was a thing, so whatever you think makes sense for the prompt is fine by me! |
|
@segevfiner is that good as is ? I'm happy to get it into 6.2, or do you want to add extra things like the prompt ? |
|
The prompt is a matter of taste. pdb's prompt is |
ok, perfect, thank you, sorry for the delay them from the overview in the PR list there was a "0 out of 1", and though you wanted to add something. Merging. |
Add what's new for PR #10721
The problem is that
Pdb.do_debugcreates a new instance of the originalPdbrather than our derivedPdb/TerminalPdb. So I copied Lib/pdb.py:1087-1102 and made it use our own class instead.I had to:
Pdb's init signature.use_rawinput. Without that the propagation ofstdouttriggersuse_rawinput = 0, breakingTerminalPdb. This is probably a bug in Python, see: bpo-31078.For IPython 5, the
self.messagelines need to be changed to aprint. See Lib/pdb.py:712-722 (2.7).Pdb's prompt calculation? Now it uses(ipdb>), adding more parentheses to each nesting level (Pdb's default prompt is(Pdb)).Fixes #1273