MCPcopy Index your code
hub / github.com/RustPython/RustPython / convert_to_error

Function convert_to_error

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

Source from the content-addressed store, hash-verified

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

Callers 2

dispatchFunction · 0.85
_callmethodMethod · 0.85

Calls 3

isinstanceFunction · 0.85
RemoteErrorClass · 0.85
formatMethod · 0.45

Tested by

no test coverage detected