objstr: split(): check arg type consistency (str vs bytes).
Similar to other methods and following CPython3 strictness.
This commit is contained in:
parent
ecca53bd34
commit
0c5498540b
@ -472,6 +472,9 @@ STATIC mp_obj_t str_split(uint n_args, const mp_obj_t *args) {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// sep given
|
// sep given
|
||||||
|
if (mp_obj_get_type(sep) != self_type) {
|
||||||
|
arg_type_mixup();
|
||||||
|
}
|
||||||
|
|
||||||
uint sep_len;
|
uint sep_len;
|
||||||
const char *sep_str = mp_obj_str_get_data(sep, &sep_len);
|
const char *sep_str = mp_obj_str_get_data(sep, &sep_len);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user