Skip to content

Commit 1155a1e

Browse files
committed
CompressionHelper - type hint compatiblity fix
1 parent cbd0671 commit 1155a1e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎UnityPy/helpers/CompressionHelper.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import gzip
22
import lzma
33
import struct
4+
from typing import Tuple
45

56
import brotli
67
import lz4.block
@@ -153,7 +154,7 @@ def compress_gzip(data: bytes) -> bytes:
153154
return gzip.compress(data)
154155

155156

156-
def chunk_based_compress(data: bytes, block_info_flag: int) -> (bytes, list):
157+
def chunk_based_compress(data: bytes, block_info_flag: int) -> Tuple[bytes, list]:
157158
"""compresses AssetBundle data based on the block_info_flag
158159
LZ4/LZ4HC will be chunk-based compression
159160
@@ -180,9 +181,9 @@ def chunk_based_compress(data: bytes, block_info_flag: int) -> (bytes, list):
180181
compressed_file_data = bytearray()
181182
p = 0
182183
while uncompressed_data_size > chunk_size:
183-
compressed_data = compress_func(data[p: p + chunk_size])
184+
compressed_data = compress_func(data[p : p + chunk_size])
184185
if len(compressed_data) > chunk_size:
185-
compressed_file_data.extend(data[p: p + chunk_size])
186+
compressed_file_data.extend(data[p : p + chunk_size])
186187
block_info.append(
187188
(
188189
chunk_size,

0 commit comments

Comments
 (0)