Skip to content

Commit e191d42

Browse files
committed
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 adafruit#847.
1 parent b534e1b commit e191d42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

py/makeqstrdata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def do_work(infiles):
5858
for order, ident, qstr in sorted(qstrs.values(), key=lambda x: x[0]):
5959
qhash = compute_hash(qstr)
6060
qlen = len(qstr)
61-
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))
61+
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))
6262

6363
return True
6464

0 commit comments

Comments
 (0)