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

Miss Islington (bot) webhook-mailer at python.org
Thu Sep 12 12:04:37 EDT 2019


https://github.com/python/cpython/commit/7da8c0aee2039685f3eff878610684f94f7f7873
commit: 7da8c0aee2039685f3eff878610684f94f7f7873
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2019-09-12T09:04:34-07: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
(cherry picked from commit 855df7f273c3988c72f01e51ba57091887ec38b2)

Co-authored-by: Daniel Hahler <github at thequod.de>

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 11d763994458..806bc6741f2b 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -1657,7 +1657,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