summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMario Corchero <mariocj89@gmail.com>2018-01-06 07:53:05 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2018-01-06 07:53:05 (GMT)
commit9f1e5f1b7f074e026843a5d70834233a95a6bf9d (patch)
tree80ec106fce0fcac6825a310881e4eb102aae7e9f /Doc
parent735ae8d139a673b30b321dc10acfd3d14f0d633b (diff)
downloadcpython-9f1e5f1b7f074e026843a5d70834233a95a6bf9d.zip
cpython-9f1e5f1b7f074e026843a5d70834233a95a6bf9d.tar.gz
cpython-9f1e5f1b7f074e026843a5d70834233a95a6bf9d.tar.bz2
bpo-32206: Pdb can now run modules (GH-4752)
Add a new argument "-m" to the pdb module to allow users to run `python -m pdb -m my_module_name`. This relies on private APIs in the runpy module to work, but we can get away with that since they're both part of the standard library and can be updated together if the runpy internals get refactored.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/pdb.rst6
-rw-r--r--Doc/whatsnew/3.7.rst4
2 files changed, 10 insertions, 0 deletions
diff --git a/Doc/library/pdb.rst b/Doc/library/pdb.rst
index 4f3148f..e81c195 100644
--- a/Doc/library/pdb.rst
+++ b/Doc/library/pdb.rst
@@ -61,6 +61,12 @@ useful than quitting the debugger upon program's exit.
:file:`pdb.py` now accepts a ``-c`` option that executes commands as if given
in a :file:`.pdbrc` file, see :ref:`debugger-commands`.
+.. versionadded:: 3.7
+ :file:`pdb.py` now accepts a ``-m`` option that execute modules similar to the way
+ ``python3 -m`` does. As with a script, the debugger will pause execution just
+ before the first line of the module.
+
+
The typical usage to break into the debugger from a running program is to
insert ::
diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst
index 1311e9e..9785d59 100644
--- a/Doc/whatsnew/3.7.rst
+++ b/Doc/whatsnew/3.7.rst
@@ -426,6 +426,10 @@ pdb
argument. If given, this is printed to the console just before debugging
begins. (Contributed by Barry Warsaw in :issue:`31389`.)
+pdb command line now accepts `-m module_name` as an alternative to
+script file. (Contributed by Mario Corchero in :issue:`32206`.)
+
+
re
--