summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-08-10 23:14:35 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-08-10 23:21:16 +0300
commit0c5498540b2005e39422647d2ca9cad1a4ff731b (patch)
treed0eb9995904bd219ed58d37287f0cdeec540927d
parentecca53bd34d946f1015d2e8f4474bcd6a950cbee (diff)
downloadmicropython-0c5498540b2005e39422647d2ca9cad1a4ff731b.tar.gz
micropython-0c5498540b2005e39422647d2ca9cad1a4ff731b.zip
objstr: split(): check arg type consistency (str vs bytes).
Similar to other methods and following CPython3 strictness.
-rw-r--r--py/objstr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/py/objstr.c b/py/objstr.c
index 6ec997f4bf..9d34609882 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);