Skip to content

Commit

Permalink
Please PyPy
Browse files Browse the repository at this point in the history
  • Loading branch information
ask committed Apr 22, 2015
1 parent d62629f commit 6efba62
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions celery/utils/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@ def __setitem__(self, key, value):
def __iter__(self):
return iter(self.data)

def _iterate_items(self):
for k in self:
try:
yield (k, self.data[k])
except KeyError: # pragma: no cover
pass
def _iterate_items(self, _need_lock=IS_PYPY):
with self.mutex if _need_lock else DummyContext():
for k in self:
try:
yield (k, self.data[k])
except KeyError: # pragma: no cover
pass
iteritems = _iterate_items

def _iterate_values(self, _need_lock=IS_PYPY):
ctx = self.mutex if _need_lock else DummyContext()
with ctx:
with self.mutex if _need_lock else DummyContext():
for k in self:
try:
yield self.data[k]
Expand Down

0 comments on commit 6efba62

Please sign in to comment.