@@ -307,14 +307,15 @@ class Pdb(bdb.Bdb, cmd.Cmd):
307
307
# Limit the maximum depth of chained exceptions, we should be handling cycles,
308
308
# but in case there are recursions, we stop at 999.
309
309
MAX_CHAINED_EXCEPTION_DEPTH = 999
310
+ DEFAULT_BACKEND = 'settrace'
310
311
311
312
_file_mtime_table = {}
312
313
313
314
_last_pdb_instance = None
314
315
315
316
def __init__ (self , completekey = 'tab' , stdin = None , stdout = None , skip = None ,
316
- nosigint = False , readrc = True , mode = None ):
317
- bdb .Bdb .__init__ (self , skip = skip , backend = 'monitoring' )
317
+ nosigint = False , readrc = True , mode = None , backend = None ):
318
+ bdb .Bdb .__init__ (self , skip = skip , backend = backend if backend else self . DEFAULT_BACKEND )
318
319
cmd .Cmd .__init__ (self , completekey , stdin , stdout )
319
320
sys .audit ("pdb.Pdb" )
320
321
if stdout :
@@ -2376,7 +2377,7 @@ def set_trace(*, header=None, commands=None):
2376
2377
if Pdb ._last_pdb_instance is not None :
2377
2378
pdb = Pdb ._last_pdb_instance
2378
2379
else :
2379
- pdb = Pdb (mode = 'inline' )
2380
+ pdb = Pdb (mode = 'inline' , backend = 'monitoring' )
2380
2381
if header is not None :
2381
2382
pdb .message (header )
2382
2383
pdb .set_trace (sys ._getframe ().f_back , commands = commands )
@@ -2507,7 +2508,7 @@ def main():
2507
2508
# modified by the script being debugged. It's a bad idea when it was
2508
2509
# changed by the user from the command line. There is a "restart" command
2509
2510
# which allows explicit specification of command line arguments.
2510
- pdb = Pdb (mode = 'cli' )
2511
+ pdb = Pdb (mode = 'cli' , backend = 'monitoring' )
2511
2512
pdb .rcLines .extend (opts .commands )
2512
2513
while True :
2513
2514
try :
0 commit comments