[Python-checkins] closes bpo-37803: pdb: fix handling of options (--help / --version) (GH-15193)

Benjamin Peterson webhook-mailer at python.org
Thu Sep 12 11:46:41 EDT 2019


https://github.com/python/cpython/commit/855df7f273c3988c72f01e51ba57091887ec38b2
commit: 855df7f273c3988c72f01e51ba57091887ec38b2
branch: master
author: Daniel Hahler <github at thequod.de>
committer: Benjamin Peterson <benjamin at python.org>
date: 2019-09-12T16:46:37+01:00
summary:

closes bpo-37803: pdb: fix handling of options (--help / --version) (GH-15193)

The "--" should not be included with long options passed to
getopt.getopt.

Fixes https://bugs.python.org/issue37803

files:
A Misc/NEWS.d/next/Tools-Demos/2019-09-12-16-15-55.bpo-37803.chEizy.rst
M Lib/pdb.py

diff --git a/Lib/pdb.py b/Lib/pdb.py
index 8c1c96163ed9..8639204891cb 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -1660,7 +1660,7 @@ def help():
 def main():
     import getopt
 
-    opts, args = getopt.getopt(sys.argv[1:], 'mhc:', ['--help', '--command='])
+    opts, args = getopt.getopt(sys.argv[1:], 'mhc:', ['help', 'command='])
 
     if not args:
         print(_usage)
diff --git a/Misc/NEWS.d/next/Tools-Demos/2019-09-12-16-15-55.bpo-37803.chEizy.rst b/Misc/NEWS.d/next/Tools-Demos/2019-09-12-16-15-55.bpo-37803.chEizy.rst
new file mode 100644
index 000000000000..5c0eedb93709
--- /dev/null
+++ b/Misc/NEWS.d/next/Tools-Demos/2019-09-12-16-15-55.bpo-37803.chEizy.rst
@@ -0,0 +1 @@
+pdb's ``--help`` and ``--version`` long options now work.



More information about the Python-checkins mailing list