Skip to content

Commit 14066c6

Browse files
committed
Fix the name of the exception when queue is empty.
1 parent d1c90a4 commit 14066c6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Interlace/lib/threader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,17 @@ def __init__(self, task_queue, timeout, output, tqdm):
6666
self.tqdm = tqdm
6767

6868
def __call__(self):
69+
queue = self.queue
6970
while True:
7071
try:
71-
# get task from queue
72-
task = next(self.queue)
72+
task = next(queue)
7373
if isinstance(self.tqdm, tqdm):
7474
self.tqdm.update(1)
7575
# run task
7676
task.run(self.tqdm)
7777
else:
7878
task.run()
79-
except IndexError:
79+
except StopIteration:
8080
break
8181

8282

0 commit comments

Comments
 (0)