mirror of https://github.com/pallets/flask.git
fix errorhandler type check
This commit is contained in:
parent
372066983f
commit
46b39e2698
|
@ -9,6 +9,7 @@ Unreleased
|
||||||
removed in Werkzeug 2.1. It is now also deprecated in Flask, to be
|
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
|
removed in Flask 2.1, while remaining compatible with both in
|
||||||
2.0.x. Use ``response.request.environ`` instead. :pr:`4341`
|
2.0.x. Use ``response.request.environ`` instead. :pr:`4341`
|
||||||
|
- Fix type annotation for ``errorhandler`` decorator. :issue:`4295`
|
||||||
|
|
||||||
|
|
||||||
Version 2.0.2
|
Version 2.0.2
|
||||||
|
|
|
@ -46,11 +46,4 @@ TemplateGlobalCallable = t.Callable[..., t.Any]
|
||||||
TemplateTestCallable = t.Callable[..., bool]
|
TemplateTestCallable = t.Callable[..., bool]
|
||||||
URLDefaultCallable = t.Callable[[str, dict], None]
|
URLDefaultCallable = t.Callable[[str, dict], None]
|
||||||
URLValuePreprocessorCallable = t.Callable[[t.Optional[str], t.Optional[dict]], None]
|
URLValuePreprocessorCallable = t.Callable[[t.Optional[str], t.Optional[dict]], None]
|
||||||
|
ErrorHandlerCallable = t.Callable[[GenericException], ResponseReturnValue]
|
||||||
|
|
||||||
if t.TYPE_CHECKING:
|
|
||||||
import typing_extensions as te
|
|
||||||
|
|
||||||
class ErrorHandlerCallable(te.Protocol[GenericException]):
|
|
||||||
def __call__(self, error: GenericException) -> ResponseReturnValue:
|
|
||||||
...
|
|
||||||
|
|
Loading…
Reference in New Issue