##// END OF EJS Templates
Backport PR #9947: Add set_trace to core debugger....
Thomas Kluyver -
Show More
@@ -621,3 +621,12 b' class Pdb(OldPdb, object):'
621 621 self.print_stack_trace()
622 622
623 623 do_w = do_where
624
625
626 def set_trace(frame=None):
627 """
628 Start debugging from `frame`.
629
630 If frame is not specified, debugging starts from caller's frame.
631 """
632 Pdb().set_trace(frame or sys._getframe().f_back)
@@ -7,6 +7,8 b' from prompt_toolkit.token import Token'
7 7 from prompt_toolkit.shortcuts import create_prompt_application
8 8 from prompt_toolkit.interface import CommandLineInterface
9 9 from prompt_toolkit.enums import EditingMode
10 import sys
11
10 12
11 13 class TerminalPdb(Pdb):
12 14 def __init__(self, *args, **kwargs):
@@ -72,6 +74,12 b' class TerminalPdb(Pdb):'
72 74 except Exception:
73 75 raise
74 76
75 def set_trace():
76 TerminalPdb().set_trace()
77
78 def set_trace(frame=None):
79 """
80 Start debugging from `frame`.
81
82 If frame is not specified, debugging starts from caller's frame.
83 """
84 TerminalPdb().set_trace(frame or sys._getframe().f_back)
77 85
General Comments 0
You need to be logged in to leave comments. Login now