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

Function _parse_value_tb

Lib/traceback.py:104–116  ·  view source on GitHub ↗
(exc, value, tb)

Source from the content-addressed store, hash-verified

102_sentinel = _Sentinel()
103
104def _parse_value_tb(exc, value, tb):
105 if (value is _sentinel) != (tb is _sentinel):
106 raise ValueError("Both or neither of value and tb must be given")
107 if value is tb is _sentinel:
108 if exc is not None:
109 if isinstance(exc, BaseException):
110 return exc, exc.__traceback__
111
112 raise TypeError(f'Exception expected for value, '
113 f'{type(exc).__name__} found')
114 else:
115 return None, None
116 return value, tb
117
118
119def print_exception(exc, /, value=_sentinel, tb=_sentinel, limit=None, \

Callers 2

print_exceptionFunction · 0.85
format_exceptionFunction · 0.85

Calls 1

isinstanceFunction · 0.85

Tested by

no test coverage detected