diff options
author | Damien George <damien.p.george@gmail.com> | 2014-09-05 13:16:19 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-09-05 13:16:19 +0100 |
commit | e191d421885ef74be1770db0f02469cc85dbfc02 (patch) | |
tree | 6d2340eae714ae61e7573377acbc5a46e07089bb /py/makeqstrdata.py | |
parent | b534e1b9f14c189d2cef209d40f598e62164694a (diff) | |
download | micropython-e191d421885ef74be1770db0f02469cc85dbfc02.tar.gz micropython-e191d421885ef74be1770db0f02469cc85dbfc02.zip |
py: Use % str formatting instead of {} in makeqstrdata.py.
Script is equivalent, but now also runs under ancient Python 2.6.
Goes part way to addressing issue #847.
Diffstat (limited to 'py/makeqstrdata.py')
-rw-r--r-- | py/makeqstrdata.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 599b936f9e..6fe8b7a425 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -58,7 +58,7 @@ def do_work(infiles): for order, ident, qstr in sorted(qstrs.values(), key=lambda x: x[0]): qhash = compute_hash(qstr) qlen = len(qstr) - print('Q({}, (const byte*)"\\x{:02x}\\x{:02x}\\x{:02x}\\x{:02x}" "{}")'.format(ident, qhash & 0xff, (qhash >> 8) & 0xff, qlen & 0xff, (qlen >> 8) & 0xff, qstr)) + print('Q(%s, (const byte*)"\\x%02x\\x%02x\\x%02x\\x%02x" "%s")' % (ident, qhash & 0xff, (qhash >> 8) & 0xff, qlen & 0xff, (qlen >> 8) & 0xff, qstr)) return True |