Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
42cec5c8
Commit
42cec5c8
authored
Sep 04, 2015
by
Damien George
Browse files
py/objstr: Check for keyword args before checking for no posn args.
Otherwise something like bytes(abc=123) will succeed.
parent
55b11e6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/objstr.c
View file @
42cec5c8
...
...
@@ -172,16 +172,16 @@ mp_obj_t mp_obj_str_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw,
STATIC
mp_obj_t
bytes_make_new
(
mp_obj_t
type_in
,
mp_uint_t
n_args
,
mp_uint_t
n_kw
,
const
mp_obj_t
*
args
)
{
(
void
)
type_in
;
if
(
n_args
==
0
)
{
return
mp_const_empty_bytes
;
}
#if MICROPY_CPYTHON_COMPAT
if
(
n_kw
!=
0
)
{
mp_arg_error_unimpl_kw
();
}
#endif
if
(
n_args
==
0
)
{
return
mp_const_empty_bytes
;
}
if
(
MP_OBJ_IS_STR
(
args
[
0
]))
{
if
(
n_args
<
2
||
n_args
>
3
)
{
goto
wrong_args
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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