]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Import WSGI types from _typeshed.wsgi 3134/head
authorSebastian Rittau <srittau@rittau.biz>
Sat, 16 Apr 2022 19:34:12 +0000 (21:34 +0200)
committerGitHub <noreply@github.com>
Sat, 16 Apr 2022 19:34:12 +0000 (21:34 +0200)
wsgiref.types is a new module in Python 3.11. Accordingly, typeshed's stubs were updated so that this module is only available from Python 3.11 onwards. But the typeshed-specific module _typeshed.wsgi (which is considered stable by typeshed) contains all the necessary definitions for all supported Python versions.

tornado/wsgi.py

index cf4eba9282479322882bd7ed58fda6a0f480ed82..f9b37db2cdbc1cbe5909faf536982e7758bed0f0 100644 (file)
@@ -41,7 +41,7 @@ import typing
 
 if typing.TYPE_CHECKING:
     from typing import Type  # noqa: F401
-    from wsgiref.types import WSGIApplication as WSGIAppType  # noqa: F401
+    from _typeshed.wsgi import WSGIApplication as WSGIAppType  # noqa: F401
 
 
 # PEP 3333 specifies that WSGI on python 3 generally deals with byte strings