MCPcopy Create free account
hub / github.com/celery/celery / get_pickleable_exception

Function get_pickleable_exception

celery/utils/serialization.py:161–172  ·  view source on GitHub ↗

Make sure exception is pickleable.

(exc)

Source from the content-addressed store, hash-verified

159
160
161def get_pickleable_exception(exc):
162 """Make sure exception is pickleable."""
163 try:
164 pickle.loads(pickle.dumps(exc))
165 except Exception: # pylint: disable=broad-except
166 pass
167 else:
168 return exc
169 nearest = find_pickleable_exception(exc)
170 if nearest:
171 return nearest
172 return UnpickleableExceptionWrapper.from_exception(exc)
173
174
175def get_pickleable_etype(cls, loads=pickle.loads, dumps=pickle.dumps):

Callers 4

__init__Method · 0.90
prepare_exceptionMethod · 0.90
handle_failureMethod · 0.90
_signal_internal_errorFunction · 0.90

Calls 2

from_exceptionMethod · 0.80

Tested by

no test coverage detected