##// END OF EJS Templates
parser: verify excessive number of args excluding kwargs in buildargsdict()...
Yuya Nishihara -
r31920:a98540ea default
parent child Browse files
Show More
@@ -135,8 +135,9 b' def buildargsdict(trees, funcname, argsp'
135 raise error.ParseError(_("%(func)s takes at least %(nargs)d positional "
135 raise error.ParseError(_("%(func)s takes at least %(nargs)d positional "
136 "arguments")
136 "arguments")
137 % {'func': funcname, 'nargs': len(poskeys)})
137 % {'func': funcname, 'nargs': len(poskeys)})
138 if not varkey and len(trees) > len(poskeys) + len(keys):
138 if not varkey and kwstart > len(poskeys) + len(keys):
139 raise error.ParseError(_("%(func)s takes at most %(nargs)d arguments")
139 raise error.ParseError(_("%(func)s takes at most %(nargs)d positional "
140 "arguments")
140 % {'func': funcname,
141 % {'func': funcname,
141 'nargs': len(poskeys) + len(keys)})
142 'nargs': len(poskeys) + len(keys)})
142 args = {}
143 args = {}
@@ -454,7 +454,7 b' keyword arguments'
454 0
454 0
455
455
456 $ log 'extra(branch, a, b)'
456 $ log 'extra(branch, a, b)'
457 hg: parse error: extra takes at most 2 arguments
457 hg: parse error: extra takes at most 2 positional arguments
458 [255]
458 [255]
459 $ log 'extra(a, label=b)'
459 $ log 'extra(a, label=b)'
460 hg: parse error: extra got multiple values for keyword argument 'label'
460 hg: parse error: extra got multiple values for keyword argument 'label'
General Comments 0
You need to be logged in to leave comments. Login now