Skip to content

Commit

Permalink
tools/mpy-tool.py: Fix frozen comment generation to escape chars.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
robert-hh authored and dpgeorge committed Feb 28, 2022
1 parent 0a21762 commit 5c46721
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/mpy-tool.py
Expand Up @@ -861,7 +861,7 @@ def freeze(self):
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(
Expand Down

0 comments on commit 5c46721

Please sign in to comment.