From: Sebastian Rittau Date: Sat, 16 Apr 2022 19:34:12 +0000 (+0200) Subject: Import WSGI types from _typeshed.wsgi X-Git-Tag: v6.2.0b1~11^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3134%2Fhead;p=thirdparty%2Ftornado.git 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. --- 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