Skip to content

Commit 4684495

Browse files
committed
Set correct max length
1 parent b3acc90 commit 4684495

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/isal/igzip_lib.pyx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ cdef class IgzipDecompressor:
321321
break
322322
return obuf
323323

324-
def decompress(self, data, Py_ssize_t max_length = 0):
324+
def decompress(self, data, Py_ssize_t max_length = -1):
325325
"""
326326
Decompress data, returning a bytes object containing the uncompressed
327327
data corresponding to at least part of the data in string.
@@ -335,10 +335,8 @@ cdef class IgzipDecompressor:
335335
cdef bint input_buffer_in_use
336336

337337
cdef Py_ssize_t hard_limit
338-
if max_length == 0:
338+
if max_length < 0:
339339
hard_limit = PY_SSIZE_T_MAX
340-
elif max_length < 0:
341-
raise ValueError("max_length can not be smaller than 0")
342340
else:
343341
hard_limit = max_length
344342

0 commit comments

Comments
 (0)