mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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). ........
This commit is contained in:
parent
1ce4c44b28
commit
c85ddcd406
3 changed files with 11 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue