Skip to content

Commit

Permalink
Merge pull request spotify#1644 from ej81/master
Browse files Browse the repository at this point in the history
Raise Queue.Empty for get() on empty queue
  • Loading branch information
erikbern committed Apr 10, 2016
2 parents 927907c + cce8bd1 commit 826cbfd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion luigi/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,10 @@ def put(self, obj, block=None, timeout=None):
return self.append(obj)

def get(self, block=None, timeout=None):
return self.pop()
try:
return self.pop()
except IndexError:
raise Queue.Empty


class AsyncCompletionException(Exception):
Expand Down

0 comments on commit 826cbfd

Please sign in to comment.