Skip to content
Snippets Groups Projects
Commit b473d0ae authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

py: bytes(), str(): Add NotImplementedError for kwargs.

Addresses #567.
parent 47d3bd3b
No related branches found
No related tags found
No related merge requests found
......@@ -108,6 +108,12 @@ STATIC void str_print(void (*print)(void *env, const char *fmt, ...), void *env,
}
STATIC mp_obj_t str_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) {
#if MICROPY_CPYTHON_COMPAT
if (n_kw != 0) {
mp_arg_error_unimpl_kw();
}
#endif
switch (n_args) {
case 0:
return MP_OBJ_NEW_QSTR(MP_QSTR_);
......@@ -146,6 +152,12 @@ STATIC mp_obj_t bytes_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const m
return mp_const_empty_bytes;
}
#if MICROPY_CPYTHON_COMPAT
if (n_kw != 0) {
mp_arg_error_unimpl_kw();
}
#endif
if (MP_OBJ_IS_STR(args[0])) {
if (n_args < 2 || n_args > 3) {
goto wrong_args;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment