Skip to content

Commit e8c9498

Browse files
committed
Check if sys.finalizing works
1 parent 7f636c8 commit e8c9498

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/zlib_ng/gzip_ng_threaded.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import os
1212
import queue
1313
import struct
14+
import sys
1415
import threading
1516
from typing import List, Optional, Tuple
1617

@@ -124,7 +125,8 @@ def _decompress(self):
124125
block_queue.put(data, timeout=0.05)
125126
break
126127
except queue.Full:
127-
pass
128+
if sys.is_finalizing():
129+
return
128130

129131
def readinto(self, b):
130132
self._check_closed()

0 commit comments

Comments
 (0)