From aa2d1e15ab45b398a158c6d45a2c75c4ede88272 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Tue, 7 Jul 2020 20:28:31 -0700 Subject: [PATCH] exo: integrate multiple PRs' split_program changes --- exosphere/program/split_program.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/exosphere/program/split_program.py b/exosphere/program/split_program.py index b52406eba..e8806c16b 100644 --- a/exosphere/program/split_program.py +++ b/exosphere/program/split_program.py @@ -3,7 +3,11 @@ import sys, lz4 from struct import unpack as up def lz4_compress(data): - return lz4.block.compress(data, 'high_compression', store_size=False) + try: + import lz4.block as block + except ImportError: + block = lz4.LZ4_compress + return block.compress(data, 'high_compression', store_size=False) def split_binary(data): A, B, START, BOOT_CODE_START, BOOT_CODE_END, PROGRAM_START, C, D = up('