tools/mpy-tool.py: Fix frozen comment generation to escape chars.
That caused the compile of frozen_content.c to fail if characters like backslash were in a short string. Thanks to @hippy for identifying the spot to change.
This commit is contained in:
parent
0a217624e1
commit
5c46721a1c
|
@ -861,7 +861,7 @@ class RawCodeBytecode(RawCode):
|
||||||
fmt, sz, arg = mp_opcode_decode(bc, ip)
|
fmt, sz, arg = mp_opcode_decode(bc, ip)
|
||||||
opcode_name = Opcodes.mapping[bc[ip]]
|
opcode_name = Opcodes.mapping[bc[ip]]
|
||||||
if fmt == MP_BC_FORMAT_QSTR:
|
if fmt == MP_BC_FORMAT_QSTR:
|
||||||
opcode_name += " " + self.qstr_table[arg].str
|
opcode_name += " " + repr(self.qstr_table[arg].str)
|
||||||
elif fmt in (MP_BC_FORMAT_VAR_UINT, MP_BC_FORMAT_OFFSET):
|
elif fmt in (MP_BC_FORMAT_VAR_UINT, MP_BC_FORMAT_OFFSET):
|
||||||
opcode_name += " %u" % arg
|
opcode_name += " %u" % arg
|
||||||
print(
|
print(
|
||||||
|
|
Loading…
Reference in New Issue