summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorTian Gao <gaogaotiantian@hotmail.com>2024-09-24 19:52:15 (GMT)
committerGitHub <noreply@github.com>2024-09-24 19:52:15 (GMT)
commitaf8403a58dbe45130400a133f756cbf53c5f1d7e (patch)
treed7155ab818e6df7448daab516b9140255cd3d6dd /Doc
parentfc9e6bf53d1c9ce2b5f802864e0da265a77c111f (diff)
downloadcpython-af8403a58dbe45130400a133f756cbf53c5f1d7e.zip
cpython-af8403a58dbe45130400a133f756cbf53c5f1d7e.tar.gz
cpython-af8403a58dbe45130400a133f756cbf53c5f1d7e.tar.bz2
gh-120254: Add a `commands` argument to `pdb.set_trace` (#120255)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/pdb.rst8
1 files changed, 7 insertions, 1 deletions
diff --git a/Doc/library/pdb.rst b/Doc/library/pdb.rst
index d696161..ce7516a 100644
--- a/Doc/library/pdb.rst
+++ b/Doc/library/pdb.rst
@@ -159,12 +159,15 @@ slightly different way:
is entered.
-.. function:: set_trace(*, header=None)
+.. function:: set_trace(*, header=None, commands=None)
Enter the debugger at the calling stack frame. This is useful to hard-code
a breakpoint at a given point in a program, even if the code is not
otherwise being debugged (e.g. when an assertion fails). If given,
*header* is printed to the console just before debugging begins.
+ The *commands* argument, if given, is a list of commands to execute
+ when the debugger starts.
+
.. versionchanged:: 3.7
The keyword-only argument *header*.
@@ -173,6 +176,9 @@ slightly different way:
:func:`set_trace` will enter the debugger immediately, rather than
on the next line of code to be executed.
+ .. versionadded:: 3.14
+ The *commands* argument.
+
.. function:: post_mortem(traceback=None)
Enter post-mortem debugging of the given *traceback* object. If no