MCPcopy Index your code
hub / github.com/python/cpython / set_trace_async

Function set_trace_async

Lib/pdb.py:2726–2739  ·  view source on GitHub ↗

Enter the debugger at the calling stack frame, but in async mode. This should be used as await pdb.set_trace_async(). Users can do await if they enter the debugger with this function. Otherwise it's the same as set_trace().

(*, header=None, commands=None)

Source from the content-addressed store, hash-verified

2724 pdb.set_trace(sys._getframe().f_back, commands=commands)
2725
2726async def set_trace_async(*, header=None, commands=None):
2727 """Enter the debugger at the calling stack frame, but in async mode.
2728
2729 This should be used as await pdb.set_trace_async(). Users can do await
2730 if they enter the debugger with this function. Otherwise it's the same
2731 as set_trace().
2732 """
2733 if Pdb._last_pdb_instance is not None:
2734 pdb = Pdb._last_pdb_instance
2735 else:
2736 pdb = Pdb(mode='inline', backend='monitoring', colorize=True)
2737 if header is not None:
2738 pdb.message(header)
2739 await pdb.set_trace_async(sys._getframe().f_back, commands=commands)
2740
2741# Remote PDB
2742

Callers

nothing calls this directly

Calls 3

messageMethod · 0.95
set_trace_asyncMethod · 0.95
PdbClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…