@@ -303,14 +303,15 @@ class Pdb(bdb.Bdb, cmd.Cmd):
303
303
# Limit the maximum depth of chained exceptions, we should be handling cycles,
304
304
# but in case there are recursions, we stop at 999.
305
305
MAX_CHAINED_EXCEPTION_DEPTH = 999
306
+ DEFAULT_BACKEND = 'settrace'
306
307
307
308
_file_mtime_table = {}
308
309
309
310
_last_pdb_instance = None
310
311
311
312
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 )
314
315
cmd .Cmd .__init__ (self , completekey , stdin , stdout )
315
316
sys .audit ("pdb.Pdb" )
316
317
if stdout :
@@ -2372,7 +2373,7 @@ def set_trace(*, header=None, commands=None):
2372
2373
if Pdb ._last_pdb_instance is not None :
2373
2374
pdb = Pdb ._last_pdb_instance
2374
2375
else :
2375
- pdb = Pdb (mode = 'inline' )
2376
+ pdb = Pdb (mode = 'inline' , backend = 'monitoring' )
2376
2377
if header is not None :
2377
2378
pdb .message (header )
2378
2379
pdb .set_trace (sys ._getframe ().f_back , commands = commands )
@@ -2487,7 +2488,7 @@ def main():
2487
2488
# modified by the script being debugged. It's a bad idea when it was
2488
2489
# changed by the user from the command line. There is a "restart" command
2489
2490
# which allows explicit specification of command line arguments.
2490
- pdb = Pdb (mode = 'cli' )
2491
+ pdb = Pdb (mode = 'cli' , backend = 'monitoring' )
2491
2492
pdb .rcLines .extend (opts .commands )
2492
2493
while True :
2493
2494
try :
0 commit comments