Skip to content

Commit

Permalink
Check if sys.finalizing works
Browse files Browse the repository at this point in the history
  • Loading branch information
rhpvorderman committed Sep 23, 2024
1 parent 7f636c8 commit e8c9498
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/zlib_ng/gzip_ng_threaded.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import os
import queue
import struct
import sys
import threading
from typing import List, Optional, Tuple

Expand Down Expand Up @@ -124,7 +125,8 @@ def _decompress(self):
block_queue.put(data, timeout=0.05)
break
except queue.Full:
pass
if sys.is_finalizing():
return

def readinto(self, b):
self._check_closed()
Expand Down

0 comments on commit e8c9498

Please sign in to comment.