This commit is contained in:
Nicolas Mowen 2025-06-12 08:57:58 -06:00
parent 85dcfdd670
commit 036d1949e7

View File

@ -340,12 +340,15 @@ def clear_and_unlink(file: Path, missing_ok: bool = True) -> None:
def empty_and_close_queue(q: mp.Queue): def empty_and_close_queue(q: mp.Queue):
while True: while True:
try:
try: try:
q.get(block=True, timeout=0.5) q.get(block=True, timeout=0.5)
except queue.Empty: except queue.Empty:
q.close() q.close()
q.join_thread() q.join_thread()
return return
except AttributeError:
pass
def generate_color_palette(n): def generate_color_palette(n):