Skip to content

Commit 739983f

Browse files
committed
Fix unclosed file on error
1 parent a0f4122 commit 739983f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/isal/igzip_threaded.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ def close(self) -> None:
268268
self.flush()
269269
self.stop()
270270
if self.exception:
271+
self.raw.close()
272+
self._closed = True
271273
raise self.exception
272274
# Write an empty deflate block with a lost block marker.
273275
self.raw.write(isal_zlib.compress(b"", wbits=-15))

0 commit comments

Comments
 (0)