Browse Source

AsyncResult.__copy__ no longer evaluates self.backend instance

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

+ 3 - 2
celery/result.py

@@ -221,8 +221,9 @@ class AsyncResult(ResultBase):
         return not self.__eq__(other)
 
     def __copy__(self):
-        r = self.__reduce__()
-        return r[0](*r[1])
+        return self.__class__(
+            self.id, self.backend, self.task_name, self.app, self.parent,
+        )
 
     def __reduce__(self):
         return self.__class__, self.__reduce_args__()