Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 11, 2023
1 parent abe7e37 commit 38bece5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@ re-raised at the hook invocation point:
print(exc)
raise
pm = PluginManager("myproject")
# register plugins
Expand Down
9 changes: 5 additions & 4 deletions src/pluggy/_callers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Call loop machinery
"""
from __future__ import annotations

from typing import cast
from typing import Generator
from typing import List
Expand Down Expand Up @@ -29,17 +30,17 @@

def _multicall(
hook_name: str,
hook_impls: Sequence["HookImpl"],
hook_impls: Sequence[HookImpl],
caller_kwargs: Mapping[str, object],
firstresult: bool,
) -> Union[object, List[object]]:
) -> object | list[object]:
"""Execute a call into multiple python functions/methods and return the
result(s).
``caller_kwargs`` comes from _HookCaller.__call__().
"""
__tracebackhide__ = True
results: List[object] = []
results: list[object] = []
exception = None
try: # run impl and wrapper setup functions in a loop
teardowns: list[Teardown] = []
Expand Down Expand Up @@ -84,7 +85,7 @@ def _multicall(
exception = exc
finally:
if firstresult: # first result hooks return a single value
outcome: _Result[Union[object, List[object]]] = _Result(
outcome: _Result[object | list[object]] = _Result(
results[0] if results else None, exception
)
else:
Expand Down

0 comments on commit 38bece5

Please sign in to comment.