From 0c5498540b2005e39422647d2ca9cad1a4ff731b Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky <pfalcon@users.sourceforge.net> Date: Sun, 10 Aug 2014 23:14:35 +0300 Subject: [PATCH] objstr: split(): check arg type consistency (str vs bytes). Similar to other methods and following CPython3 strictness. --- py/objstr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/py/objstr.c b/py/objstr.c index 6ec997f4b..9d3460988 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -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); -- GitLab