@@ -303,14 +303,15 @@ class Pdb(bdb.Bdb, cmd.Cmd):
303303 # Limit the maximum depth of chained exceptions, we should be handling cycles,
304304 # but in case there are recursions, we stop at 999.
305305 MAX_CHAINED_EXCEPTION_DEPTH = 999
306+ DEFAULT_BACKEND = 'settrace'
306307
307308 _file_mtime_table = {}
308309
309310 _last_pdb_instance = None
310311
311312 def __init__ (self , completekey = 'tab' , stdin = None , stdout = None , skip = None ,
312- nosigint = False , readrc = True , mode = None ):
313- bdb .Bdb .__init__ (self , skip = skip , backend = 'monitoring' )
313+ nosigint = False , readrc = True , mode = None , backend = None ):
314+ bdb .Bdb .__init__ (self , skip = skip , backend = backend if backend else self . DEFAULT_BACKEND )
314315 cmd .Cmd .__init__ (self , completekey , stdin , stdout )
315316 sys .audit ("pdb.Pdb" )
316317 if stdout :
@@ -2372,7 +2373,7 @@ def set_trace(*, header=None, commands=None):
23722373 if Pdb ._last_pdb_instance is not None :
23732374 pdb = Pdb ._last_pdb_instance
23742375 else :
2375- pdb = Pdb (mode = 'inline' )
2376+ pdb = Pdb (mode = 'inline' , backend = 'monitoring' )
23762377 if header is not None :
23772378 pdb .message (header )
23782379 pdb .set_trace (sys ._getframe ().f_back , commands = commands )
@@ -2487,7 +2488,7 @@ def main():
24872488 # modified by the script being debugged. It's a bad idea when it was
24882489 # changed by the user from the command line. There is a "restart" command
24892490 # which allows explicit specification of command line arguments.
2490- pdb = Pdb (mode = 'cli' )
2491+ pdb = Pdb (mode = 'cli' , backend = 'monitoring' )
24912492 pdb .rcLines .extend (opts .commands )
24922493 while True :
24932494 try :
0 commit comments