diff options
author | Damien George <damien.p.george@gmail.com> | 2015-09-03 23:03:57 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-09-03 23:03:57 +0100 |
commit | e2aa1177986d11cbd19ab84ca41b6f0dce51ad01 (patch) | |
tree | 007e94406cefb7f46b105c0d7883c882a91d1924 /py | |
parent | 516982242df9eff369f5b2eb9e320f48ba19cdc2 (diff) | |
download | micropython-e2aa1177986d11cbd19ab84ca41b6f0dce51ad01.tar.gz micropython-e2aa1177986d11cbd19ab84ca41b6f0dce51ad01.zip |
py/objstr: Simplify printing of bytes objects when unicode enabled.
Diffstat (limited to 'py')
-rw-r--r-- | py/objstr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/py/objstr.c b/py/objstr.c index 42a1d5c5d4..4a0705af37 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -116,8 +116,12 @@ STATIC void str_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t return; } #endif + #if !MICROPY_PY_BUILTINS_STR_UNICODE bool is_bytes = MP_OBJ_IS_TYPE(self_in, &mp_type_bytes); - if (kind == PRINT_STR && !is_bytes) { + #else + bool is_bytes = true; + #endif + if (!MICROPY_PY_BUILTINS_STR_UNICODE && kind == PRINT_STR && !is_bytes) { mp_printf(print, "%.*s", str_len, str_data); } else { if (is_bytes) { |