##// END OF EJS Templates
Add frame parameter to terminal debugger.
tillahoffmann -
Show More
@@ -7,6 +7,8 b' from prompt_toolkit.token import Token'
7 from prompt_toolkit.shortcuts import create_prompt_application
7 from prompt_toolkit.shortcuts import create_prompt_application
8 from prompt_toolkit.interface import CommandLineInterface
8 from prompt_toolkit.interface import CommandLineInterface
9 from prompt_toolkit.enums import EditingMode
9 from prompt_toolkit.enums import EditingMode
10 import sys
11
10
12
11 class TerminalPdb(Pdb):
13 class TerminalPdb(Pdb):
12 def __init__(self, *args, **kwargs):
14 def __init__(self, *args, **kwargs):
@@ -72,8 +74,14 b' class TerminalPdb(Pdb):'
72 except Exception:
74 except Exception:
73 raise
75 raise
74
76
75 def set_trace():
77
76 TerminalPdb().set_trace()
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
78
86
79 if __name__ == '__main__':
87 if __name__ == '__main__':
General Comments 0
You need to be logged in to leave comments. Login now