fix errorhandler type check

This commit is contained in:
Bojan Delić 2021-10-07 01:09:32 +02:00 committed by David Lord
parent 372066983f
commit 46b39e2698
No known key found for this signature in database
GPG Key ID: 7A1C87E3F5BC42A8
2 changed files with 2 additions and 8 deletions

View File

@ -9,6 +9,7 @@ Unreleased
removed in Werkzeug 2.1. It is now also deprecated in Flask, to be
removed in Flask 2.1, while remaining compatible with both in
2.0.x. Use ``response.request.environ`` instead. :pr:`4341`
- Fix type annotation for ``errorhandler`` decorator. :issue:`4295`
Version 2.0.2

View File

@ -46,11 +46,4 @@ TemplateGlobalCallable = t.Callable[..., t.Any]
TemplateTestCallable = t.Callable[..., bool]
URLDefaultCallable = t.Callable[[str, dict], None]
URLValuePreprocessorCallable = t.Callable[[t.Optional[str], t.Optional[dict]], None]
if t.TYPE_CHECKING:
import typing_extensions as te
class ErrorHandlerCallable(te.Protocol[GenericException]):
def __call__(self, error: GenericException) -> ResponseReturnValue:
...
ErrorHandlerCallable = t.Callable[[GenericException], ResponseReturnValue]