Skip to content

Commit b7c0295

Browse files
use runtime union for EXCEPTION_OR_MORE
1 parent 9295f9f commit b7c0295

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/_pytest/_code/code.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@
3030
from typing import Pattern
3131
from typing import Sequence
3232
from typing import SupportsIndex
33+
from typing import Tuple
34+
from typing import Type
3335
from typing import TypeVar
36+
from typing import Union
3437

3538
import pluggy
3639

@@ -53,9 +56,7 @@
5356

5457
TracebackStyle = Literal["long", "short", "line", "no", "native", "value", "auto"]
5558

56-
EXCEPTION_OR_MORE = type[Exception] | tuple[type[Exception], ...]
57-
58-
type_alias = type # to sidestep shadowing
59+
EXCEPTION_OR_MORE = Union[Type[Exception], Tuple[Type[Exception], ...]]
5960

6061

6162
class Code:

0 commit comments

Comments
 (0)