Skip to content

Commit e2aa117

Browse files
committed
py/objstr: Simplify printing of bytes objects when unicode enabled.
1 parent 5169822 commit e2aa117

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

py/objstr.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,12 @@ STATIC void str_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t
116116
return;
117117
}
118118
#endif
119+
#if !MICROPY_PY_BUILTINS_STR_UNICODE
119120
bool is_bytes = MP_OBJ_IS_TYPE(self_in, &mp_type_bytes);
120-
if (kind == PRINT_STR && !is_bytes) {
121+
#else
122+
bool is_bytes = true;
123+
#endif
124+
if (!MICROPY_PY_BUILTINS_STR_UNICODE && kind == PRINT_STR && !is_bytes) {
121125
mp_printf(print, "%.*s", str_len, str_data);
122126
} else {
123127
if (is_bytes) {

0 commit comments

Comments
 (0)