]> granicus.if.org Git - python/commitdiff
closes bpo-37803: pdb: fix handling of options (--help / --version) (GH-15193)
authorDaniel Hahler <github@thequod.de>
Thu, 12 Sep 2019 15:46:37 +0000 (17:46 +0200)
committerBenjamin Peterson <benjamin@python.org>
Thu, 12 Sep 2019 15:46:37 +0000 (16:46 +0100)
The "--" should not be included with long options passed to
getopt.getopt.

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

Lib/pdb.py
Misc/NEWS.d/next/Tools-Demos/2019-09-12-16-15-55.bpo-37803.chEizy.rst [new file with mode: 0644]

index 8c1c96163ed913c538e6b7a4064ddfb6fd59a06a..8639204891cb01e11134bc7f9171ab079b3f6e0d 100755 (executable)
@@ -1660,7 +1660,7 @@ To let the script run up to a given line X in the debugged file, use
 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 (file)
index 0000000..5c0eedb
--- /dev/null
@@ -0,0 +1 @@
+pdb's ``--help`` and ``--version`` long options now work.