Преглед на файлове

New AsyncResult.__eq__ broke join_native

Ask Solem преди 13 години
родител
ревизия
326ea1eca7
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      celery/result.py

+ 3 - 1
celery/result.py

@@ -202,7 +202,9 @@ class AsyncResult(ResultBase):
 
     def __eq__(self, other):
         if isinstance(other, AsyncResult):
-            return self.id == other.id
+            return other.id == self.id
+        elif isinstance(other, basestring):
+            return other == self.id
         return NotImplemented
 
     def __copy__(self):