diff --git a/src/werkzeug/_internal.py b/src/werkzeug/_internal.py index 71a5e2883..7d33563ec 100644 --- a/src/werkzeug/_internal.py +++ b/src/werkzeug/_internal.py @@ -13,9 +13,9 @@ from weakref import WeakKeyDictionary if t.TYPE_CHECKING: - from wsgiref.types import StartResponse - from wsgiref.types import WSGIApplication - from wsgiref.types import WSGIEnvironment + from _typeshed.wsgi import StartResponse + from _typeshed.wsgi import WSGIApplication + from _typeshed.wsgi import WSGIEnvironment from .wrappers.request import Request # noqa: F401 _logger: t.Optional[logging.Logger] = None diff --git a/src/werkzeug/datastructures.pyi b/src/werkzeug/datastructures.pyi index 292e1a262..b61540ec6 100644 --- a/src/werkzeug/datastructures.pyi +++ b/src/werkzeug/datastructures.pyi @@ -20,7 +20,7 @@ from typing import Tuple from typing import Type from typing import TypeVar from typing import Union -from wsgiref.types import WSGIEnvironment +from _typeshed.wsgi import WSGIEnvironment from typing_extensions import Literal diff --git a/src/werkzeug/debug/__init__.py b/src/werkzeug/debug/__init__.py index 03ccae3d9..ca46bb92f 100644 --- a/src/werkzeug/debug/__init__.py +++ b/src/werkzeug/debug/__init__.py @@ -25,9 +25,9 @@ from .tbtools import Traceback if t.TYPE_CHECKING: - from wsgiref.types import StartResponse - from wsgiref.types import WSGIApplication - from wsgiref.types import WSGIEnvironment + from _typeshed.wsgi import StartResponse + from _typeshed.wsgi import WSGIApplication + from _typeshed.wsgi import WSGIEnvironment # A week PIN_TIME = 60 * 60 * 24 * 7 diff --git a/src/werkzeug/exceptions.py b/src/werkzeug/exceptions.py index 7c43d85ef..718c8ebb0 100644 --- a/src/werkzeug/exceptions.py +++ b/src/werkzeug/exceptions.py @@ -53,8 +53,8 @@ def application(request): if t.TYPE_CHECKING: import typing_extensions as te - from wsgiref.types import StartResponse - from wsgiref.types import WSGIEnvironment + from _typeshed.wsgi import StartResponse + from _typeshed.wsgi import WSGIEnvironment from .datastructures import WWWAuthenticate from .sansio.response import Response from .wrappers.response import Response as WSGIResponse # noqa: F401 diff --git a/src/werkzeug/formparser.py b/src/werkzeug/formparser.py index c24608d05..2dcb709fc 100644 --- a/src/werkzeug/formparser.py +++ b/src/werkzeug/formparser.py @@ -33,7 +33,7 @@ if t.TYPE_CHECKING: import typing as te - from wsgiref.types import WSGIEnvironment + from _typeshed.wsgi import WSGIEnvironment t_parse_result = t.Tuple[t.BinaryIO, MultiDict, MultiDict] diff --git a/src/werkzeug/http.py b/src/werkzeug/http.py index 8880d553e..ca48fe215 100644 --- a/src/werkzeug/http.py +++ b/src/werkzeug/http.py @@ -26,7 +26,7 @@ if t.TYPE_CHECKING: import typing_extensions as te - from wsgiref.types import WSGIEnvironment + from _typeshed.wsgi import WSGIEnvironment # for explanation of "media-range", etc. see Sections 5.3.{1,2} of RFC 7231 _accept_re = re.compile( diff --git a/src/werkzeug/local.py b/src/werkzeug/local.py index 4e664a011..a5a7870e4 100644 --- a/src/werkzeug/local.py +++ b/src/werkzeug/local.py @@ -10,9 +10,9 @@ from .wsgi import ClosingIterator if t.TYPE_CHECKING: - from wsgiref.types import StartResponse - from wsgiref.types import WSGIApplication - from wsgiref.types import WSGIEnvironment + from _typeshed.wsgi import StartResponse + from _typeshed.wsgi import WSGIApplication + from _typeshed.wsgi import WSGIEnvironment F = t.TypeVar("F", bound=t.Callable[..., t.Any]) diff --git a/src/werkzeug/middleware/dispatcher.py b/src/werkzeug/middleware/dispatcher.py index 5f79db910..ace1c7504 100644 --- a/src/werkzeug/middleware/dispatcher.py +++ b/src/werkzeug/middleware/dispatcher.py @@ -33,9 +33,9 @@ import typing as t if t.TYPE_CHECKING: - from wsgiref.types import StartResponse - from wsgiref.types import WSGIApplication - from wsgiref.types import WSGIEnvironment + from _typeshed.wsgi import StartResponse + from _typeshed.wsgi import WSGIApplication + from _typeshed.wsgi import WSGIEnvironment class DispatcherMiddleware: diff --git a/src/werkzeug/middleware/http_proxy.py b/src/werkzeug/middleware/http_proxy.py index c09231c11..1cde458df 100644 --- a/src/werkzeug/middleware/http_proxy.py +++ b/src/werkzeug/middleware/http_proxy.py @@ -17,9 +17,9 @@ from ..wsgi import get_input_stream if t.TYPE_CHECKING: - from wsgiref.types import StartResponse - from wsgiref.types import WSGIApplication - from wsgiref.types import WSGIEnvironment + from _typeshed.wsgi import StartResponse + from _typeshed.wsgi import WSGIApplication + from _typeshed.wsgi import WSGIEnvironment class ProxyMiddleware: diff --git a/src/werkzeug/middleware/lint.py b/src/werkzeug/middleware/lint.py index 6e7df0ab9..80c423dd3 100644 --- a/src/werkzeug/middleware/lint.py +++ b/src/werkzeug/middleware/lint.py @@ -22,9 +22,9 @@ from ..wsgi import FileWrapper if t.TYPE_CHECKING: - from wsgiref.types import StartResponse - from wsgiref.types import WSGIApplication - from wsgiref.types import WSGIEnvironment + from _typeshed.wsgi import StartResponse + from _typeshed.wsgi import WSGIApplication + from _typeshed.wsgi import WSGIEnvironment class WSGIWarning(Warning): diff --git a/src/werkzeug/middleware/profiler.py b/src/werkzeug/middleware/profiler.py index a15e4b4f6..0992f8f16 100644 --- a/src/werkzeug/middleware/profiler.py +++ b/src/werkzeug/middleware/profiler.py @@ -23,9 +23,9 @@ from profile import Profile # type: ignore if t.TYPE_CHECKING: - from wsgiref.types import StartResponse - from wsgiref.types import WSGIApplication - from wsgiref.types import WSGIEnvironment + from _typeshed.wsgi import StartResponse + from _typeshed.wsgi import WSGIApplication + from _typeshed.wsgi import WSGIEnvironment class ProfilerMiddleware: diff --git a/src/werkzeug/middleware/proxy_fix.py b/src/werkzeug/middleware/proxy_fix.py index e1f8d3219..e90b1b34e 100644 --- a/src/werkzeug/middleware/proxy_fix.py +++ b/src/werkzeug/middleware/proxy_fix.py @@ -26,9 +26,9 @@ from ..http import parse_list_header if t.TYPE_CHECKING: - from wsgiref.types import StartResponse - from wsgiref.types import WSGIApplication - from wsgiref.types import WSGIEnvironment + from _typeshed.wsgi import StartResponse + from _typeshed.wsgi import WSGIApplication + from _typeshed.wsgi import WSGIEnvironment class ProxyFix: diff --git a/src/werkzeug/middleware/shared_data.py b/src/werkzeug/middleware/shared_data.py index 9d172f7b7..f11b43a03 100644 --- a/src/werkzeug/middleware/shared_data.py +++ b/src/werkzeug/middleware/shared_data.py @@ -31,9 +31,9 @@ _TLoader = t.Callable[[t.Optional[str]], t.Tuple[t.Optional[str], t.Optional[_TOpener]]] if t.TYPE_CHECKING: - from wsgiref.types import StartResponse - from wsgiref.types import WSGIApplication - from wsgiref.types import WSGIEnvironment + from _typeshed.wsgi import StartResponse + from _typeshed.wsgi import WSGIApplication + from _typeshed.wsgi import WSGIEnvironment class SharedDataMiddleware: diff --git a/src/werkzeug/routing.py b/src/werkzeug/routing.py index 59463a7f7..104387593 100644 --- a/src/werkzeug/routing.py +++ b/src/werkzeug/routing.py @@ -140,8 +140,8 @@ if t.TYPE_CHECKING: import typing_extensions as te - from wsgiref.types import WSGIApplication - from wsgiref.types import WSGIEnvironment + from _typeshed.wsgi import WSGIApplication + from _typeshed.wsgi import WSGIEnvironment from .wrappers.response import Response _rule_re = re.compile( diff --git a/src/werkzeug/serving.py b/src/werkzeug/serving.py index 97cd01013..1be994929 100644 --- a/src/werkzeug/serving.py +++ b/src/werkzeug/serving.py @@ -75,8 +75,8 @@ class ForkingMixIn: # type: ignore if t.TYPE_CHECKING: import typing_extensions as te # noqa: F401 - from wsgiref.types import WSGIApplication - from wsgiref.types import WSGIEnvironment + from _typeshed.wsgi import WSGIApplication + from _typeshed.wsgi import WSGIEnvironment from cryptography.hazmat.primitives.asymmetric.rsa import ( RSAPrivateKeyWithSerialization, ) diff --git a/src/werkzeug/test.py b/src/werkzeug/test.py index 8815b0f79..9301c02fd 100644 --- a/src/werkzeug/test.py +++ b/src/werkzeug/test.py @@ -46,8 +46,8 @@ from .wsgi import get_current_url if t.TYPE_CHECKING: - from wsgiref.types import WSGIApplication - from wsgiref.types import WSGIEnvironment + from _typeshed.wsgi import WSGIApplication + from _typeshed.wsgi import WSGIEnvironment def stream_encode_multipart( diff --git a/src/werkzeug/testapp.py b/src/werkzeug/testapp.py index 76f83974b..981f8878b 100644 --- a/src/werkzeug/testapp.py +++ b/src/werkzeug/testapp.py @@ -13,8 +13,8 @@ from .wrappers.response import Response if t.TYPE_CHECKING: - from wsgiref.types import StartResponse - from wsgiref.types import WSGIEnvironment + from _typeshed.wsgi import StartResponse + from _typeshed.wsgi import WSGIEnvironment logo = Response( diff --git a/src/werkzeug/useragents.py b/src/werkzeug/useragents.py index 9ff940312..4deed8f46 100644 --- a/src/werkzeug/useragents.py +++ b/src/werkzeug/useragents.py @@ -5,7 +5,7 @@ from .user_agent import UserAgent as _BaseUserAgent if t.TYPE_CHECKING: - from wsgiref.types import WSGIEnvironment + from _typeshed.wsgi import WSGIEnvironment class _UserAgentParser: diff --git a/src/werkzeug/utils.py b/src/werkzeug/utils.py index 5255294cc..7bb02bbc1 100644 --- a/src/werkzeug/utils.py +++ b/src/werkzeug/utils.py @@ -25,7 +25,7 @@ from .wsgi import wrap_file if t.TYPE_CHECKING: - from wsgiref.types import WSGIEnvironment + from _typeshed.wsgi import WSGIEnvironment from .wrappers.request import Request from .wrappers.response import Response diff --git a/src/werkzeug/wrappers/request.py b/src/werkzeug/wrappers/request.py index 7862e58dc..60c3b5f4e 100644 --- a/src/werkzeug/wrappers/request.py +++ b/src/werkzeug/wrappers/request.py @@ -23,8 +23,8 @@ if t.TYPE_CHECKING: import typing_extensions as te - from wsgiref.types import WSGIApplication - from wsgiref.types import WSGIEnvironment + from _typeshed.wsgi import WSGIApplication + from _typeshed.wsgi import WSGIEnvironment class Request(_SansIORequest): diff --git a/src/werkzeug/wrappers/response.py b/src/werkzeug/wrappers/response.py index 60d011c1b..a43c8bca3 100644 --- a/src/werkzeug/wrappers/response.py +++ b/src/werkzeug/wrappers/response.py @@ -23,9 +23,9 @@ if t.TYPE_CHECKING: import typing_extensions as te - from wsgiref.types import StartResponse - from wsgiref.types import WSGIApplication - from wsgiref.types import WSGIEnvironment + from _typeshed.wsgi import StartResponse + from _typeshed.wsgi import WSGIApplication + from _typeshed.wsgi import WSGIEnvironment def _warn_if_string(iterable: t.Iterable) -> None: diff --git a/src/werkzeug/wsgi.py b/src/werkzeug/wsgi.py index 587cf3f42..9439a1e5c 100644 --- a/src/werkzeug/wsgi.py +++ b/src/werkzeug/wsgi.py @@ -17,8 +17,8 @@ from .urls import url_quote if t.TYPE_CHECKING: - from wsgiref.types import WSGIApplication - from wsgiref.types import WSGIEnvironment + from _typeshed.wsgi import WSGIApplication + from _typeshed.wsgi import WSGIEnvironment def responder(f: t.Callable[..., "WSGIApplication"]) -> "WSGIApplication":