objstr: split(): check arg type consistency (str vs bytes).

Similar to other methods and following CPython3 strictness.
This commit is contained in:
Paul Sokolovsky 2014-08-10 23:14:35 +03:00
parent ecca53bd34
commit 0c5498540b
1 changed files with 3 additions and 0 deletions

View File

@ -472,6 +472,9 @@ STATIC mp_obj_t str_split(uint n_args, const mp_obj_t *args) {
} else {
// sep given
if (mp_obj_get_type(sep) != self_type) {
arg_type_mixup();
}
uint sep_len;
const char *sep_str = mp_obj_str_get_data(sep, &sep_len);