diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-07-24 00:49:20 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-07-24 00:49:20 (GMT) |
commit | eccc5facd34609c029efce6fd2cd302f73e50566 (patch) | |
tree | 4af5f6eb27248a69da350aaa0c27f136f5666b84 /Lib/getopt.py | |
parent | a565874cc1a00e19716e537675adad46c00a7531 (diff) | |
download | cpython-eccc5facd34609c029efce6fd2cd302f73e50566.zip cpython-eccc5facd34609c029efce6fd2cd302f73e50566.tar.gz cpython-eccc5facd34609c029efce6fd2cd302f73e50566.tar.bz2 |
Issue #4629: getopt raises an error if an argument ends with = whereas getopt
doesn't except a value (eg. --help= is rejected if getopt uses ['help='] long
options).
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 13ef4d6..ac77126 100644 --- a/Lib/getopt.py +++ b/Lib/getopt.py @@ -156,7 +156,7 @@ def do_longs(opts, opt, longopts, args): if not args: raise GetoptError('option --%s requires argument' % opt, opt) optarg, args = args[0], args[1:] - elif optarg: + elif optarg is not None: raise GetoptError('option --%s must not have an argument' % opt, opt) opts.append(('--' + opt, optarg or '')) return opts, args |