Browse Source

pickling regen must give list not generator

Ask Solem 11 năm trước cách đây
mục cha
commit
b4023d3ab3
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      celery/utils/functional.py

+ 3 - 0
celery/utils/functional.py

@@ -290,6 +290,9 @@ class _regen(UserList, list):
     def __init__(self, it):
         self.__it = it
 
+    def __reduce__(self):
+        return list, (self.data, )
+
     @cached_property
     def data(self):
         return list(self.__it)