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.
pull/8367/head
robert-hh 2022-02-26 07:55:53 +01:00 zatwierdzone przez Damien George
rodzic 0a217624e1
commit 5c46721a1c
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -861,7 +861,7 @@ class RawCodeBytecode(RawCode):
fmt, sz, arg = mp_opcode_decode(bc, ip)
opcode_name = Opcodes.mapping[bc[ip]]
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):
opcode_name += " %u" % arg
print(