Skip to content

Commit

Permalink
Fix AttributeError.
Browse files Browse the repository at this point in the history
  • Loading branch information
nvie committed Apr 1, 2012
1 parent c337afd commit b886ba7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rq/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,10 @@ def top(self):
return None

def __len__(self):
return len(self._local.stack)
stack = getattr(self._local, 'stack', None)
if stack is None:
return 0
return len(stack)


class LocalManager(object):
Expand Down

0 comments on commit b886ba7

Please sign in to comment.