summaryrefslogtreecommitdiffstats
path: root/Lib/getopt.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-07-24 01:12:54 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-07-24 01:12:54 (GMT)
commita417db544e8b58aeefb7cc57ed3274dbb93d944f (patch)
tree05f12e62468ef413459ec7e3259af11ab2c55999 /Lib/getopt.py
parent1270bb9d14507577c15a5f5c039681f04a3bc4ea (diff)
downloadcpython-a417db544e8b58aeefb7cc57ed3274dbb93d944f.zip
cpython-a417db544e8b58aeefb7cc57ed3274dbb93d944f.tar.gz
cpython-a417db544e8b58aeefb7cc57ed3274dbb93d944f.tar.bz2
Merged revisions 83117 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/release27-maint ................ r83117 | victor.stinner | 2010-07-24 03:07:52 +0200 (sam., 24 juil. 2010) | 11 lines Merged revisions 83116 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83116 | victor.stinner | 2010-07-24 02:49:20 +0200 (sam., 24 juil. 2010) | 4 lines 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.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/getopt.py b/Lib/getopt.py
index 04e881e..f76d3de 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