File tree 4 files changed +7
-3
lines changed
4 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ Unreleased
12
12
imports in user projects. :issue: `4024 `
13
13
- Fix type annotation for ``g `` and inform mypy that it is a namespace
14
14
object that has arbitrary attributes. :issue: `4020 `
15
+ - Fix some types that weren't available in Python 3.6.0. :issue: `4040 `
15
16
16
17
17
18
Version 2.0.0
Original file line number Diff line number Diff line change 72
72
from .wrappers import Response
73
73
74
74
if t .TYPE_CHECKING :
75
+ import typing_extensions as te
75
76
from .blueprints import Blueprint
76
77
from .testing import FlaskClient
77
78
from .testing import FlaskCliRunner
@@ -1441,7 +1442,7 @@ def log_exception(
1441
1442
f"Exception on { request .path } [{ request .method } ]" , exc_info = exc_info
1442
1443
)
1443
1444
1444
- def raise_routing_exception (self , request : Request ) -> t .NoReturn :
1445
+ def raise_routing_exception (self , request : Request ) -> "te .NoReturn" :
1445
1446
"""Exceptions that are recording during routing are reraised with
1446
1447
this method. During debug we are not reraising redirect requests
1447
1448
for non ``GET``, ``HEAD``, or ``OPTIONS`` requests and we're raising
Original file line number Diff line number Diff line change 12
12
from .json .tag import TaggedJSONSerializer
13
13
14
14
if t .TYPE_CHECKING :
15
+ import typing_extensions as te
15
16
from .app import Flask
16
17
from .wrappers import Request , Response
17
18
@@ -92,7 +93,7 @@ class NullSession(SecureCookieSession):
92
93
but fail on setting.
93
94
"""
94
95
95
- def _fail (self , * args : t .Any , ** kwargs : t .Any ) -> t .NoReturn :
96
+ def _fail (self , * args : t .Any , ** kwargs : t .Any ) -> "te .NoReturn" :
96
97
raise RuntimeError (
97
98
"The session is unavailable because no secret "
98
99
"key was set. Set the secret_key on the "
Original file line number Diff line number Diff line change 8
8
from .globals import current_app
9
9
10
10
if t .TYPE_CHECKING :
11
+ import typing_extensions as te
11
12
from werkzeug .routing import Rule
12
13
13
14
@@ -91,7 +92,7 @@ def _load_form_data(self) -> None:
91
92
92
93
attach_enctype_error_multidict (self )
93
94
94
- def on_json_loading_failed (self , e : Exception ) -> t .NoReturn :
95
+ def on_json_loading_failed (self , e : Exception ) -> "te .NoReturn" :
95
96
if current_app and current_app .debug :
96
97
raise BadRequest (f"Failed to decode JSON object: { e } " )
97
98
You can’t perform that action at this time.
0 commit comments