Jelajahi Sumber

pickling regen must give list not generator

Ask Solem 11 tahun lalu
induk
melakukan
1a2e5a1188
1 mengubah file dengan 3 tambahan dan 0 penghapusan
  1. 3 0
      celery/utils/functional.py

+ 3 - 0
celery/utils/functional.py

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