summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/mpremote/mpremote/commands.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/mpremote/mpremote/commands.py b/tools/mpremote/mpremote/commands.py
index 690b2ea72..1e13b33af 100644
--- a/tools/mpremote/mpremote/commands.py
+++ b/tools/mpremote/mpremote/commands.py
@@ -649,7 +649,9 @@ def _do_romfs_deploy(state, args):
romfs_chunk += bytes(chunk_size - len(romfs_chunk))
if has_deflate_io:
# Needs: binascii.a2b_base64, io.BytesIO, deflate.DeflateIO.
- romfs_chunk_compressed = zlib.compress(romfs_chunk, wbits=-9)
+ compressor = zlib.compressobj(wbits=-9)
+ romfs_chunk_compressed = compressor.compress(romfs_chunk)
+ romfs_chunk_compressed += compressor.flush()
buf = binascii.b2a_base64(romfs_chunk_compressed).strip()
transport.exec(f"buf=DeflateIO(BytesIO(a2b_base64({buf})),RAW,9).read()")
elif has_a2b_base64: