diff options
Diffstat (limited to 'py/objstr.c')
-rw-r--r-- | py/objstr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/py/objstr.c b/py/objstr.c index 8c639e735..bd3e16e7f 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -233,7 +233,11 @@ STATIC mp_obj_t bytes_make_new(const mp_obj_type_t *type_in, size_t n_args, size if (mp_obj_is_str(args[0])) { if (n_args < 2 || n_args > 3) { + #if MICROPY_ERROR_REPORTING <= MICROPY_ERROR_REPORTING_TERSE goto wrong_args; + #else + mp_raise_TypeError(MP_ERROR_TEXT("string argument without an encoding")); + #endif } GET_STR_DATA_LEN(args[0], str_data, str_len); GET_STR_HASH(args[0], str_hash); |