| 26 | |
| 27 | |
| 28 | class ErrorWrapper(Representation): |
| 29 | __slots__ = 'exc', '_loc' |
| 30 | |
| 31 | def __init__(self, exc: Exception, loc: Union[str, 'Loc']) -> None: |
| 32 | self.exc = exc |
| 33 | self._loc = loc |
| 34 | |
| 35 | def loc_tuple(self) -> 'Loc': |
| 36 | if isinstance(self._loc, tuple): |
| 37 | return self._loc |
| 38 | else: |
| 39 | return (self._loc,) |
| 40 | |
| 41 | def __repr_args__(self) -> 'ReprArgs': |
| 42 | return [('exc', self.exc), ('loc', self.loc_tuple())] |
| 43 | |
| 44 | |
| 45 | # ErrorList is something like Union[List[Union[List[ErrorWrapper], ErrorWrapper]], ErrorWrapper] |
no outgoing calls
no test coverage detected