8000 gh-123756: Only allow restart in command line mode by gaogaotiantian · Pull Request #123757 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-123756: Only allow restart in command line mode #123757

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update docs
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
  • Loading branch information
gaogaotiantian and iritkatriel authored Sep 25, 2024
commit c50b03995a092e414a5285da3a87766727b7f335
8 changes: 4 additions & 4 deletions Doc/library/pdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ access further features, you have to do this yourself:

The *mode* argument specifies how the debugger was invoked.
It impacts the workings of some debugger commands.
Valid values are ``'inline'`` (when called from the breakpoint() builtin),
``'cli'`` (when called from a command line invocation)
Valid values are ``'inline'`` (used by the breakpoint() builtin),
``'cli'`` (used by the command line invocation)
or ``None`` (for backwards compatible behaviour, as before the *mode*
argument was added).

Expand Down Expand Up @@ -686,8 +686,8 @@ can be overridden by the local file.
:pdbcmd:`restart` is an alias for :pdbcmd:`run`.

.. versionchanged:: 3.14
:pdbcmd:`run` and :pdbcmd:`restart` commands are not allowed when the
debugger is invoked from an inline breakpoint.
:pdbcmd:`run` and :pdbcmd:`restart` commands are disabled when the
debugger is invoked in ``'inline'`` mode.

.. pdbcommand:: q(uit)

Expand Down
2 changes: 1 addition & 1 deletion Lib/pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1613,7 +1613,7 @@ def do_run(self, arg):
are preserved. "restart" is an alias for "run".
"""
if self.mode == 'inline':
self.error('run/restart command is disabled in inline breakpoints.\n'
self.error('run/restart command is disabled when pdb is running in inline mode.\n'
'Use the command line interface to enable restarting your program\n'
'e.g. "python -m pdb myscript.py"')
return
Expand Down
Loading
0