1 parent 95836f8 commit 99ab64fCopy full SHA for 99ab64f
1 file changed
py/makeqstrdata.py
@@ -92,7 +92,7 @@ def do_work(infiles):
92
if qlen >= cfg_max_len:
93
print('qstr is too long:', qstr)
94
assert False
95
- 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))
96
print('QDEF(MP_QSTR_%s, (const byte*)"\\x%02x\\x%02x%s" "%s")' % (ident, qhash & 0xff, (qhash >> 8) & 0xff, qlen_str, qdata))
97
98
return True
0 commit comments