(exc, value, tb)
| 102 | _sentinel = _Sentinel() |
| 103 | |
| 104 | def _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 | |
| 119 | def print_exception(exc, /, value=_sentinel, tb=_sentinel, limit=None, \ |
no test coverage detected