From 404598faec3f1cb853da9e6284a90e0eff1e0696 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Sat, 16 Apr 2022 21:34:12 +0200 Subject: [PATCH] Import WSGI types from _typeshed.wsgi 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tornado/wsgi.py b/tornado/wsgi.py index cf4eba928..f9b37db2c 100644 --- a/tornado/wsgi.py +++ b/tornado/wsgi.py @@ -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 -- 2.47.2