fix errorhandler type check

This commit is contained in:
Bojan Delić 2021-10-07 01:09:32 +02:00
parent 8ddf80c3ea
commit 470a08b36b
2 changed files with 9 additions and 8 deletions

View file

@ -1,5 +1,13 @@
.. currentmodule:: flask
Version 2.0.3
-------------
Unreleased
- Fix type issue with `app.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]