|
2 | 2 | from __future__ import annotations |
3 | 3 |
|
4 | 4 | import ast |
| 5 | +from collections.abc import Iterable |
| 6 | +from collections.abc import Mapping |
| 7 | +from collections.abc import Sequence |
5 | 8 | import dataclasses |
6 | 9 | import inspect |
7 | 10 | from inspect import CO_VARARGS |
|
10 | 13 | import os |
11 | 14 | from pathlib import Path |
12 | 15 | import re |
| 16 | +from re import Pattern |
13 | 17 | import sys |
14 | 18 | import traceback |
15 | 19 | from traceback import format_exception_only |
|
22 | 26 | from typing import Final |
23 | 27 | from typing import final |
24 | 28 | from typing import Generic |
25 | | -from typing import Iterable |
26 | | -from typing import List |
27 | 29 | from typing import Literal |
28 | | -from typing import Mapping |
29 | 30 | from typing import overload |
30 | | -from typing import Pattern |
31 | | -from typing import Sequence |
32 | 31 | from typing import SupportsIndex |
33 | | -from typing import Tuple |
34 | | -from typing import Type |
35 | 32 | from typing import TypeVar |
36 | 33 | from typing import Union |
37 | 34 |
|
|
56 | 53 |
|
57 | 54 | TracebackStyle = Literal["long", "short", "line", "no", "native", "value", "auto"] |
58 | 55 |
|
59 | | -EXCEPTION_OR_MORE = Union[Type[BaseException], Tuple[Type[BaseException], ...]] |
| 56 | +EXCEPTION_OR_MORE = Union[type[BaseException], tuple[type[BaseException], ...]] |
60 | 57 |
|
61 | 58 |
|
62 | 59 | class Code: |
@@ -320,7 +317,7 @@ def name(self) -> str: |
320 | 317 | return self.frame.code.raw.co_name |
321 | 318 |
|
322 | 319 |
|
323 | | -class Traceback(List[TracebackEntry]): |
| 320 | +class Traceback(list[TracebackEntry]): |
324 | 321 | """Traceback objects encapsulate and offer higher level access to Traceback entries.""" |
325 | 322 |
|
326 | 323 | def __init__( |
|
0 commit comments