diff options
author | Georg Brandl <georg@python.org> | 2008-12-05 09:23:14 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-12-05 09:23:14 +0000 |
commit | a07435d3e3dfee3e4d8998baa7fadbfaf46f764d (patch) | |
tree | 1c749e787fde8e79d694630fcf18679835613d1a /Lib/getopt.py | |
parent | 8d6c49047f2725ebb67212689e7eef2388dfbcdc (diff) | |
download | cpython-git-a07435d3e3dfee3e4d8998baa7fadbfaf46f764d.tar.gz |
#4458: recognize "-" as an argument, not a malformed option in gnu_getopt().
Diffstat (limited to 'Lib/getopt.py')
-rw-r--r-- | Lib/getopt.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/getopt.py b/Lib/getopt.py index 04e881ec73..7248f08a32 100644 --- a/Lib/getopt.py +++ b/Lib/getopt.py @@ -130,7 +130,7 @@ def gnu_getopt(args, shortopts, longopts = []): if args[0][:2] == '--': opts, args = do_longs(opts, args[0][2:], longopts, args[1:]) - elif args[0][:1] == '-': + elif args[0][:1] == '-' and args[0] != '-': opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:]) else: if all_options_first: |