Просмотр исходного кода

AsyncResult.__copy__ no longer evaluates self.backend instance

Ask Solem 11 лет назад
Родитель
Сommit
b283b194c1
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      celery/result.py

+ 3 - 2
celery/result.py

@@ -221,8 +221,9 @@ class AsyncResult(ResultBase):
         return not self.__eq__(other)
         return not self.__eq__(other)
 
 
     def __copy__(self):
     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):
     def __reduce__(self):
         return self.__class__, self.__reduce_args__()
         return self.__class__, self.__reduce_args__()