[Python-checkins] bpo-32206: Update pdb usage to include new module option (GH-5111)

Nick Coghlan webhook-mailer at python.org
Sat Jan 27 23:58:50 EST 2018


https://github.com/python/cpython/commit/fcf8b4c1022bc2d2f84dcef5d72eabf40a25ea19
commit: fcf8b4c1022bc2d2f84dcef5d72eabf40a25ea19
branch: master
author: Mario Corchero <mariocj89 at gmail.com>
committer: Nick Coghlan <ncoghlan at gmail.com>
date: 2018-01-28T14:58:47+10:00
summary:

bpo-32206: Update pdb usage to include new module option (GH-5111)

files:
M Lib/pdb.py
M Lib/test/test_pdb.py

diff --git a/Lib/pdb.py b/Lib/pdb.py
index d1a74bb7d7be..366a85b31960 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -1638,9 +1638,11 @@ def help():
     pydoc.pager(__doc__)
 
 _usage = """\
-usage: pdb.py [-c command] ... pyfile [arg] ...
+usage: pdb.py [-c command] ... [-m module | pyfile] [arg] ...
 
-Debug the Python program given by pyfile.
+Debug the Python program given by pyfile. Alternatively,
+an executable module or package to debug can be specified using
+the -m switch.
 
 Initial commands are read from .pdbrc files in your home directory
 and in the current directory, if they exist.  Commands supplied with
diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
index 0cd235e98ae1..85b47d533491 100644
--- a/Lib/test/test_pdb.py
+++ b/Lib/test/test_pdb.py
@@ -1182,7 +1182,10 @@ def test_run_pdb_with_pdb(self):
             quit
         """
         stdout, stderr = self._run_pdb(["-m", "pdb"], commands)
-        self.assertIn("Debug the Python program given by pyfile.", stdout.splitlines())
+        self.assertIn(
+            pdb._usage,
+            stdout.replace('\r', '')  # remove \r for windows
+        )
 
     def test_module_without_a_main(self):
         module_name = 't_main'



More information about the Python-checkins mailing list