Browse Source

tests passing

Ask Solem 12 năm trước cách đây
mục cha
commit
c5d34e900c
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      celery/utils/serialization.py

+ 6 - 0
celery/utils/serialization.py

@@ -159,6 +159,12 @@ class UnpickleableExceptionWrapper(Exception):
 
 def get_pickleable_exception(exc):
     """Make sure exception is pickleable."""
+    try:
+        pickle.loads(pickle.dumps(exc))
+    except Exception:
+        pass
+    else:
+        return exc
     nearest = find_nearest_pickleable_exception(exc)
     if nearest:
         return nearest