Fix BytesIO non-emptiness check

This commit is contained in:
Adrián Chaves 2023-11-24 11:35:15 +01:00
parent 8a73c6c90c
commit a113208a06
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ def gunzip(data: bytes, *, max_size: int = 0) -> bytes:
# complete only if there is some data, otherwise re-raise
# see issue 87 about catching struct.error
# some pages are quite small so output_stream is empty
if output_stream:
if output_stream.getbuffer().nbytes > 0:
break
raise
decompressed_size += len(chunk)