Skip to content

Commit 6e6ccb2

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 5497a73 commit 6e6ccb2

7 files changed

Lines changed: 12 additions & 15 deletions

File tree

src/pluggy/_hooks.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from __future__ import annotations
66

7+
from collections.abc import Callable
78
from collections.abc import Generator
89
from collections.abc import Mapping
910
from collections.abc import Sequence
@@ -12,10 +13,8 @@
1213
import sys
1314
from types import ModuleType
1415
from typing import Any
15-
from typing import Callable
1616
from typing import Final
1717
from typing import final
18-
from typing import Optional
1918
from typing import overload
2019
from typing import TYPE_CHECKING
2120
from typing import TypedDict
@@ -32,9 +31,9 @@
3231
_Plugin = object
3332
_HookExec = Callable[
3433
[str, Sequence["HookImpl"], Mapping[str, object], bool],
35-
Union[object, list[object]],
34+
object | list[object],
3635
]
37-
_HookImplFunction = Callable[..., Union[_T, Generator[None, Result[_T], None]]]
36+
_HookImplFunction = Callable[..., _T | Generator[None, Result[_T], None]]
3837

3938

4039
class HookspecOpts(TypedDict):
@@ -374,7 +373,7 @@ def __getattr__(self, name: str) -> HookCaller: ...
374373
_HookRelay = HookRelay
375374

376375

377-
_CallHistory = list[tuple[Mapping[str, object], Optional[Callable[[Any], None]]]]
376+
_CallHistory = list[tuple[Mapping[str, object], Callable[[Any], None] | None]]
378377

379378

380379
class HookCaller:

src/pluggy/_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from __future__ import annotations
22

3+
from collections.abc import Callable
34
from collections.abc import Iterable
45
from collections.abc import Mapping
56
from collections.abc import Sequence
67
import inspect
78
import types
89
from typing import Any
9-
from typing import Callable
1010
from typing import cast
1111
from typing import Final
1212
from typing import TYPE_CHECKING

src/pluggy/_result.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@
44

55
from __future__ import annotations
66

7+
from collections.abc import Callable
78
from types import TracebackType
8-
from typing import Callable
99
from typing import cast
1010
from typing import final
1111
from typing import Generic
12-
from typing import Optional
1312
from typing import TypeVar
1413

1514

16-
_ExcInfo = tuple[type[BaseException], BaseException, Optional[TracebackType]]
15+
_ExcInfo = tuple[type[BaseException], BaseException, TracebackType | None]
1716
ResultType = TypeVar("ResultType")
1817

1918

src/pluggy/_tracing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
from __future__ import annotations
66

7+
from collections.abc import Callable
78
from collections.abc import Sequence
89
from typing import Any
9-
from typing import Callable
1010

1111

1212
_Writer = Callable[[str], object]

testing/test_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
from collections.abc import Callable
12
from functools import wraps
23
from typing import Any
3-
from typing import Callable
44
from typing import cast
55
from typing import TypeVar
66

testing/test_hookcaller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
from collections.abc import Callable
12
from collections.abc import Generator
23
from collections.abc import Sequence
3-
from typing import Callable
44
from typing import TypeVar
55

66
import pytest

testing/test_multicall.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
from collections.abc import Callable
12
from collections.abc import Mapping
23
from collections.abc import Sequence
3-
from typing import Callable
4-
from typing import Union
54

65
import pytest
76

@@ -20,7 +19,7 @@ def MC(
2019
methods: Sequence[Callable[..., object]],
2120
kwargs: Mapping[str, object],
2221
firstresult: bool = False,
23-
) -> Union[object, list[object]]:
22+
) -> object | list[object]:
2423
caller = _multicall
2524
hookfuncs = []
2625
for method in methods:

0 commit comments

Comments
 (0)