Skip to content

Commit 1610d06

Browse files
committed
Switch arg check back to allow ignored args for strings
1 parent 9435e01 commit 1610d06

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

py/objstr.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,6 @@ STATIC mp_obj_t bytes_make_new(const mp_obj_type_t *type_in, size_t n_args, cons
212212
return mp_const_empty_bytes;
213213
}
214214

215-
if (n_args > 1) {
216-
goto wrong_args;
217-
}
218-
219215
if (MP_OBJ_IS_STR(args[0])) {
220216
if (n_args < 2 || n_args > 3) {
221217
goto wrong_args;
@@ -242,6 +238,10 @@ STATIC mp_obj_t bytes_make_new(const mp_obj_type_t *type_in, size_t n_args, cons
242238
return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr);
243239
}
244240

241+
if (n_args > 1) {
242+
goto wrong_args;
243+
}
244+
245245
// check if __bytes__ exists, and if so delegate to it
246246
mp_obj_t dest[2];
247247
mp_load_method_maybe(args[0], MP_QSTR___bytes__, dest);

0 commit comments

Comments
 (0)