objstr: Make .split() support bytes.
diff --git a/py/objstr.c b/py/objstr.c
index 7549ded..d062f05 100644
--- a/py/objstr.c
+++ b/py/objstr.c
@@ -411,6 +411,7 @@
 #define is_ws(c) ((c) == ' ' || (c) == '\t')
 
 STATIC mp_obj_t str_split(uint n_args, const mp_obj_t *args) {
+    const mp_obj_type_t *self_type = mp_obj_get_type(args[0]);
     machine_int_t splits = -1;
     mp_obj_t sep = mp_const_none;
     if (n_args > 1) {
@@ -432,7 +433,7 @@
         while (s < top && splits != 0) {
             const byte *start = s;
             while (s < top && !is_ws(*s)) s++;
-            mp_obj_list_append(res, mp_obj_new_str(start, s - start, false));
+            mp_obj_list_append(res, str_new(self_type, start, s - start));
             if (s >= top) {
                 break;
             }
@@ -443,7 +444,7 @@
         }
 
         if (s < top) {
-            mp_obj_list_append(res, mp_obj_new_str(s, top - s, false));
+            mp_obj_list_append(res, str_new(self_type, s, top - s));
         }
 
     } else {
@@ -467,7 +468,7 @@
                 }
                 s++;
             }
-            mp_obj_list_append(res, mp_obj_new_str(start, s - start, false));
+            mp_obj_list_append(res, str_new(self_type, start, s - start));
             if (s >= top) {
                 break;
             }