Skip to content

Commit 0c54985

Browse files
committed
objstr: split(): check arg type consistency (str vs bytes).
Similar to other methods and following CPython3 strictness.
1 parent ecca53b commit 0c54985

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

py/objstr.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,9 @@ STATIC mp_obj_t str_split(uint n_args, const mp_obj_t *args) {
472472

473473
} else {
474474
// sep given
475+
if (mp_obj_get_type(sep) != self_type) {
476+
arg_type_mixup();
477+
}
475478

476479
uint sep_len;
477480
const char *sep_str = mp_obj_str_get_data(sep, &sep_len);

0 commit comments

Comments
 (0)