]> granicus.if.org Git - python/commitdiff
bpo-32206: Update pdb usage to include new module option (GH-5111)
authorMario Corchero <mariocj89@gmail.com>
Sun, 28 Jan 2018 04:58:47 +0000 (04:58 +0000)
committerNick Coghlan <ncoghlan@gmail.com>
Sun, 28 Jan 2018 04:58:47 +0000 (14:58 +1000)
Lib/pdb.py
Lib/test/test_pdb.py

index d1a74bb7d7be9dd8ad5b31564672475c5a255eb5..366a85b31960a612068aba6148b4d66ed3a5c887 100755 (executable)
@@ -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
index 0cd235e98ae191a763c5d3814c75047686699544..85b47d5334917a02814f86d7d2c87a7d783683a8 100644 (file)
@@ -1182,7 +1182,10 @@ class PdbTestCase(unittest.TestCase):
             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'