Pārlūkot izejas kodu

Result.get must handle None exceptions. Closes #2560

Ask Solem 9 gadi atpakaļ
vecāks
revīzija
1a49171972
1 mainītis faili ar 6 papildinājumiem un 5 dzēšanām
  1. 6 5
      celery/backends/base.py

+ 6 - 5
celery/backends/base.py

@@ -165,11 +165,12 @@ class BaseBackend(object):
 
     def exception_to_python(self, exc):
         """Convert serialized exception to Python exception."""
-        if self.serializer in EXCEPTION_ABLE_CODECS:
-            return get_pickled_exception(exc)
-        elif not isinstance(exc, BaseException):
-            return create_exception_cls(
-                from_utf8(exc['exc_type']), __name__)(exc['exc_message'])
+        if exc:
+            if self.serializer in EXCEPTION_ABLE_CODECS:
+                return get_pickled_exception(exc)
+            elif not isinstance(exc, BaseException):
+                return create_exception_cls(
+                    from_utf8(exc['exc_type']), __name__)(exc['exc_message'])
         return exc
 
     def prepare_value(self, result):