use runtime union for EXCEPTION_OR_MORE

This commit is contained in:
Ronny Pfannschmidt 2024-06-17 17:12:34 +02:00
parent 8e495e32c6
commit d51fac48d6
1 changed files with 4 additions and 3 deletions

View File

@ -30,7 +30,10 @@ from typing import overload
from typing import Pattern from typing import Pattern
from typing import Sequence from typing import Sequence
from typing import SupportsIndex from typing import SupportsIndex
from typing import Tuple
from typing import Type
from typing import TypeVar from typing import TypeVar
from typing import Union
import pluggy import pluggy
@ -53,9 +56,7 @@ if sys.version_info < (3, 11):
_TracebackStyle = Literal["long", "short", "line", "no", "native", "value", "auto"] _TracebackStyle = Literal["long", "short", "line", "no", "native", "value", "auto"]
EXCEPTION_OR_MORE = type[Exception] | tuple[type[Exception], ...] EXCEPTION_OR_MORE = Union[Type[Exception], Tuple[Type[Exception], ...]]
type_alias = type # to sidestep shadowing
class Code: class Code: