Skip to content

Commit fcf8b4c

Browse files
mariocj89ncoghlan
authored andcommitted
bpo-32206: Update pdb usage to include new module option (GH-5111)
1 parent dd0e087 commit fcf8b4c

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Lib/pdb.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1638,9 +1638,11 @@ def help():
16381638
pydoc.pager(__doc__)
16391639

16401640
_usage = """\
1641-
usage: pdb.py [-c command] ... pyfile [arg] ...
1641+
usage: pdb.py [-c command] ... [-m module | pyfile] [arg] ...
16421642
1643-
Debug the Python program given by pyfile.
1643+
Debug the Python program given by pyfile. Alternatively,
1644+
an executable module or package to debug can be specified using
1645+
the -m switch.
16441646
16451647
Initial commands are read from .pdbrc files in your home directory
16461648
and in the current directory, if they exist. Commands supplied with

Lib/test/test_pdb.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,10 @@ def test_run_pdb_with_pdb(self):
11821182
quit
11831183
"""
11841184
stdout, stderr = self._run_pdb(["-m", "pdb"], commands)
1185-
self.assertIn("Debug the Python program given by pyfile.", stdout.splitlines())
1185+
self.assertIn(
1186+
pdb._usage,
1187+
stdout.replace('\r', '') # remove \r for windows
1188+
)
11861189

11871190
def test_module_without_a_main(self):
11881191
module_name = 't_main'

0 commit comments

Comments
 (0)