MCPcopy Index your code
hub / github.com/python/cpython / convert_to_error

Function convert_to_error

Lib/multiprocessing/managers.py:99–112  ·  view source on GitHub ↗
(kind, result)

Source from the content-addressed store, hash-verified

97 del result # break reference cycle
98
99def convert_to_error(kind, result):
100 if kind == '#ERROR':
101 return result
102 elif kind in ('#TRACEBACK', '#UNSERIALIZABLE'):
103 if not isinstance(result, str):
104 raise TypeError(
105 "Result {0!r} (kind '{1}') type is {2}, not str".format(
106 result, kind, type(result)))
107 if kind == '#UNSERIALIZABLE':
108 return RemoteError('Unserializable message: %s\n' % result)
109 else:
110 return RemoteError(result)
111 else:
112 return ValueError('Unrecognized message type {!r}'.format(kind))
113
114class RemoteError(Exception):
115 def __str__(self):

Callers 2

dispatchFunction · 0.85
_callmethodMethod · 0.85

Calls 2

RemoteErrorClass · 0.85
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…