summaryrefslogtreecommitdiffstatshomepage
path: root/py/makecompresseddata.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-04-09 17:33:36 +1000
committerDamien George <damien.p.george@gmail.com>2020-04-13 22:21:57 +1000
commit7654907e1e4dfce096091f61cbdf4bb898225ab0 (patch)
tree01ce732c20931d5d139de1517d2352a7e8e4ef67 /py/makecompresseddata.py
parent8e048d2548867aac743866ca5a4c244b7b5aac09 (diff)
downloadmicropython-7654907e1e4dfce096091f61cbdf4bb898225ab0.tar.gz
micropython-7654907e1e4dfce096091f61cbdf4bb898225ab0.zip
py/makecompresseddata.py: Don't prefix str with mark if not compressed.
Diffstat (limited to 'py/makecompresseddata.py')
-rw-r--r--py/makecompresseddata.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/py/makecompresseddata.py b/py/makecompresseddata.py
index 26d6703a9e..28223a6d9c 100644
--- a/py/makecompresseddata.py
+++ b/py/makecompresseddata.py
@@ -168,7 +168,11 @@ def main(collected_path, fn):
# Print the replacements.
for uncomp, comp in error_strings.items():
- print('MP_MATCH_COMPRESSED("{}", "\\{:03o}{}")'.format(uncomp, _COMPRESSED_MARKER, comp))
+ if uncomp == comp:
+ prefix = ""
+ else:
+ prefix = "\\{:03o}".format(_COMPRESSED_MARKER)
+ print('MP_MATCH_COMPRESSED("{}", "{}{}")'.format(uncomp, prefix, comp))
# Used to calculate the "true" length of the (escaped) compressed strings.
def unescape(s):