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 19, 2023
1 parent cc80a47 commit 80cf589
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 80cf589

Please sign in to comment.