Explorar el Código

Always lock before modiying LRUCache (Issue #2897)

Ask Solem hace 8 años
padre
commit
8c8f1906f5
Se han modificado 1 ficheros con 1 adiciones y 3 borrados
  1. 1 3
      celery/utils/functional.py

+ 1 - 3
celery/utils/functional.py

@@ -67,9 +67,7 @@ class LRUCache(UserDict):
                 for _ in range(len(data) - limit):
                     data.popitem(last=False)
 
-    def popitem(self, last=True, _needs_lock=IS_PYPY):
-        if not _needs_lock:
-            return self.data.popitem(last)
+    def popitem(self, last=True):
         with self.mutex:
             return self.data.popitem(last)