Skip to content

Commit

Permalink
Correct the error handler typing
Browse files Browse the repository at this point in the history
It may also be awaitable, as invocations are wrapped in ensure_sync.
  • Loading branch information
pgjones committed Aug 14, 2023
1 parent 6c0024d commit 9a54c90
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/flask/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@
# https://github.com/pallets/flask/issues/4095
# https://github.com/pallets/flask/issues/4295
# https://github.com/pallets/flask/issues/4297
ErrorHandlerCallable = t.Callable[[t.Any], ResponseReturnValue]
ErrorHandlerCallable = t.Union[
t.Callable[[t.Any], ResponseReturnValue],
t.Callable[[t.Any], t.Awaitable[ResponseReturnValue]],
]

RouteCallable = t.Union[
t.Callable[..., ResponseReturnValue],
Expand Down

0 comments on commit 9a54c90

Please sign in to comment.