diff --git a/resources/lib/backgroundthread.py b/resources/lib/backgroundthread.py index 682dcd8f..60acc59e 100644 --- a/resources/lib/backgroundthread.py +++ b/resources/lib/backgroundthread.py @@ -284,7 +284,10 @@ class OrderedQueue(Queue.PriorityQueue, object): super(OrderedQueue, self).__init__(maxsize) def _qsize(self, len=len): - return len(self.queue) if self.queue[0][0] == self.next_index else 0 + try: + return len(self.queue) if self.queue[0][0] == self.next_index else 0 + except IndexError: + return 0 def _get(self, heappop=heapq.heappop): self.next_index += 1