From 21bfff9a5a766acfbdd899687850f563893a0f9e Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Thu, 12 Sep 2019 09:05:52 -0700 Subject: 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 --- Lib/pdb.py | 2 +- Misc/NEWS.d/next/Tools-Demos/2019-09-12-16-15-55.bpo-37803.chEizy.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Tools-Demos/2019-09-12-16-15-55.bpo-37803.chEizy.rst diff --git a/Lib/pdb.py b/Lib/pdb.py index 8c1c961..8639204 100755 --- a/Lib/pdb.py +++ b/Lib/pdb.py @@ -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 index 0000000..5c0eedb --- /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. -- cgit v0.12