diff options
author | Tom Collins <tom.collins@digi.com> | 2020-03-09 11:39:44 -0700 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-03-11 14:31:29 +1100 |
commit | fccf17521aeec7438785a132434137f266474119 (patch) | |
tree | 5242f78cb8c081ac0d713c314b020bc290b756e9 /py/objstr.c | |
parent | ed848553b408e14746f0ce96c8b20517bfdede35 (diff) |
py/objstr: Remove duplicate % in error string.
The double-% was added in 11de8399fe5f9ef54589b14470faf8d4fcc5ccaa (Jun
2014) when such errors were formatted with printf. But then
55830dd9bf4fee87c0a6d3f38c51614fea0eb483 (Dec 2018) changed
mp_obj_new_exception_msg() to not format the message, as discussed
in #3004. So such error strings are no longer formatted and a % is just
that.
Diffstat (limited to 'py/objstr.c')
-rw-r--r-- | py/objstr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/objstr.c b/py/objstr.c index aba03491d..aa35d84a8 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -1523,7 +1523,7 @@ STATIC mp_obj_t str_modulo_format(mp_obj_t pattern, size_t n_args, const mp_obj_ size_t slen; const char *s = mp_obj_str_get_data(arg, &slen); if (slen != 1) { - mp_raise_TypeError("%%c needs int or char"); + mp_raise_TypeError("%c needs int or char"); } mp_print_strn(&print, s, 1, flags, ' ', width); } else if (arg_looks_integer(arg)) { |