Commit d50f649c authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

py/objstr: Applying % (format) operator to bytes should return bytes, not str.

parent ef63ab57
......@@ -1484,7 +1484,7 @@ not_enough_args:
nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "not all arguments converted during string formatting"));
return mp_obj_new_str_from_vstr(&mp_type_str, &vstr);
return mp_obj_new_str_from_vstr(is_bytes ? &mp_type_bytes : &mp_type_str, &vstr);
// The implementation is optimized, returning the original string if there's
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment