Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
64ba6ca1
Commit
64ba6ca1
authored
Apr 21, 2014
by
Damien George
Browse files
py: Small change to mp_arg_parse_all.
parent
643284fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/argcheck.c
View file @
64ba6ca1
...
...
@@ -40,7 +40,7 @@ void mp_arg_parse_all(uint n_pos, const mp_obj_t *pos, mp_map_t *kws, uint n_all
mp_obj_t
given_arg
;
if
(
i
<
n_pos
)
{
if
(
allowed
[
i
].
flags
&
MP_ARG_PARSE_KW_ONLY
)
{
nlr_raise
(
mp_obj_new_exception_msg_varg
(
&
mp_type_TypeError
,
"'%s' argument must be given by a keyword"
,
qstr_str
(
allowed
[
i
].
qstr
)))
;
goto
extra_positional
;
}
pos_found
++
;
given_arg
=
pos
[
i
];
...
...
@@ -69,6 +69,7 @@ void mp_arg_parse_all(uint n_pos, const mp_obj_t *pos, mp_map_t *kws, uint n_all
}
if
(
pos_found
<
n_pos
)
{
// TODO better error message
extra_positional:
nlr_raise
(
mp_obj_new_exception_msg
(
&
mp_type_TypeError
,
"extra positional arguments given"
));
}
if
(
kws_found
<
kws
->
used
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment