From 14066c608abbf7f7a41595a6cd8057e1fb173537 Mon Sep 17 00:00:00 2001 From: Ira Lun Date: Thu, 1 Oct 2020 20:42:54 +0100 Subject: [PATCH] Fix the name of the exception when queue is empty. --- Interlace/lib/threader.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Interlace/lib/threader.py b/Interlace/lib/threader.py index 2bc7af7..1038eaa 100644 --- a/Interlace/lib/threader.py +++ b/Interlace/lib/threader.py @@ -66,17 +66,17 @@ class Worker(object): self.tqdm = tqdm def __call__(self): + queue = self.queue while True: try: - # get task from queue - task = next(self.queue) + task = next(queue) if isinstance(self.tqdm, tqdm): self.tqdm.update(1) # run task task.run(self.tqdm) else: task.run() - except IndexError: + except StopIteration: break