Ask Solem hace 8 años
padre
commit
a2849a5b06
Se han modificado 2 ficheros con 3 adiciones y 6 borrados
  1. 2 5
      celery/result.py
  2. 1 1
      t/unit/utils/test_saferepr.py

+ 2 - 5
celery/result.py

@@ -869,12 +869,9 @@ class GroupResult(ResultSet):
     @classmethod
     def restore(cls, id, backend=None, app=None):
         """Restore previously saved group result."""
-
         app = app or cls.app
-
-        return (
-            backend or (app.backend if app else current_app.backend)
-        ).restore_group(id)
+        backend = backend or (app.backend if app else current_app.backend)
+        return backend.restore_group(id)
 
 
 @Thenable.register

+ 1 - 1
t/unit/utils/test_saferepr.py

@@ -230,5 +230,5 @@ class test_saferepr:
                 raise KeyError('foo')
         assert 'Unrepresentable' in saferepr(O())
 
-    def test_bytes_with_unicode(self):
+    def test_bytes_with_unicode_py2_and_3(self):
         assert saferepr([b'foo', 'a®rgs'.encode('utf-8')])