summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-01-11 22:40:38 +0000
committerDamien George <damien.p.george@gmail.com>2015-01-11 22:40:38 +0000
commit99ab64ffd4a85e3e97eab2c9db41fa46ca6e01fc (patch)
tree6b839ea45e2b06685e53a9100d2f5f2e6c4d0c13 /py
parent95836f8439b9f1ca0b6ff20f56a03253aa9ba836 (diff)
downloadmicropython-99ab64ffd4a85e3e97eab2c9db41fa46ca6e01fc.tar.gz
micropython-99ab64ffd4a85e3e97eab2c9db41fa46ca6e01fc.zip
py/makeqstrdata.py: Make it work again with both Python2 and Python3.
Diffstat (limited to 'py')
-rw-r--r--py/makeqstrdata.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py
index 48fd9e09d4..3c0fa512ef 100644
--- a/py/makeqstrdata.py
+++ b/py/makeqstrdata.py
@@ -92,7 +92,7 @@ def do_work(infiles):
if qlen >= cfg_max_len:
print('qstr is too long:', qstr)
assert False
- qlen_str = ('\\x%02x' * cfg_bytes_len) % tuple(qlen.to_bytes(cfg_bytes_len, 'little'))
+ qlen_str = ('\\x%02x' * cfg_bytes_len) % tuple(((qlen >> (8 * i)) & 0xff) for i in range(cfg_bytes_len))
print('QDEF(MP_QSTR_%s, (const byte*)"\\x%02x\\x%02x%s" "%s")' % (ident, qhash & 0xff, (qhash >> 8) & 0xff, qlen_str, qdata))
return True