Skip to content

Commit 884587b

Browse files
committed
Fix linting issues
1 parent 493f14f commit 884587b

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/isal/igzip.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
BUFFER_SIZE = _compression.BUFFER_SIZE
4242

43+
4344
# The open method was copied from the python source with minor adjustments.
4445
def open(filename, mode="rb", compresslevel=_COMPRESS_LEVEL_TRADEOFF,
4546
encoding=None, errors=None, newline=None):
@@ -167,7 +168,7 @@ def read(self, size=-1):
167168
while True:
168169
if self._decompressor.eof:
169170
buf = (self._decompressor.unused_data or
170-
self._fp.read(BUFFER_SIZE))
171+
self._fp.read(BUFFER_SIZE))
171172
if not buf:
172173
break
173174
# Continue to next stream.
@@ -212,18 +213,12 @@ def compress(data, compresslevel=_COMPRESS_LEVEL_BEST, *, mtime=None):
212213

213214

214215
# Unlike stdlib, do not use the roundabout way of doing this via a file.
215-
# def decompress(data):
216-
# """Decompress a gzip compressed string in one shot.
217-
# Return the decompressed string.
218-
# """
219-
# return isal_zlib.decompress(data, wbits=16 + isal_zlib.MAX_WBITS)
220-
221216
def decompress(data):
222217
"""Decompress a gzip compressed string in one shot.
223218
Return the decompressed string.
224219
"""
225-
with IGzipFile(fileobj=io.BytesIO(data)) as f:
226-
return f.read()
220+
return isal_zlib.decompress(data, wbits=16 + isal_zlib.MAX_WBITS)
221+
227222

228223
def main():
229224
parser = argparse.ArgumentParser()

0 commit comments

Comments
 (0)