diff options
author | Damien George <damien.p.george@gmail.com> | 2019-10-18 19:18:06 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-10-29 22:22:37 +1100 |
commit | 709136e844f93eb7b9ea8c14e9daa5da8e8293d3 (patch) | |
tree | d2b585ef47209d414dccbe4ab5383979370baf7d /tests/basics/string_repr.py | |
parent | 4847460232764a116b731da077074818e316fb55 (diff) | |
download | micropython-709136e844f93eb7b9ea8c14e9daa5da8e8293d3.tar.gz micropython-709136e844f93eb7b9ea8c14e9daa5da8e8293d3.zip |
tests/basics: Use str.format instead of % for formatting messages.
Only use % formatting when testing % itself, because only str.format is
guaranteed to be available on any port.
Diffstat (limited to 'tests/basics/string_repr.py')
-rw-r--r-- | tests/basics/string_repr.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/basics/string_repr.py b/tests/basics/string_repr.py index 2a3ef2527c..b4842e1475 100644 --- a/tests/basics/string_repr.py +++ b/tests/basics/string_repr.py @@ -1,4 +1,4 @@ # anything above 0xa0 is printed as Unicode by CPython # the abobe is CPython implementation detail, stick to ASCII for c in range(0x80): - print("0x%02x: %s" % (c, repr(chr(c)))) + print("0x{:02x}: {}".format(c, repr(chr(c)))) |