From: Ben Darnell Date: Tue, 8 Feb 2022 02:20:47 +0000 (-0500) Subject: web: Fix type annotation for docs build X-Git-Tag: v6.2.0b1~20^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf116788aa0c1e2e43b6bc55a63c1b5ab8aaa8b3;p=thirdparty%2Ftornado.git web: Fix type annotation for docs build Our version of sphinx isn't resolving this annotation correctly. Introduced in #3014 because CI was broken when it was submitted. --- diff --git a/docs/conf.py b/docs/conf.py index efa1c01d0..c47edd6f5 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -128,6 +128,7 @@ missing_references = { "tornado.options._Mockable", "tornado.web._ArgDefaultMarker", "tornado.web._HandlerDelegate", + "_RequestHandlerType", "traceback", "WSGIAppType", "Yieldable", diff --git a/tornado/web.py b/tornado/web.py index 589d21a15..2dab485a4 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -1822,10 +1822,10 @@ class RequestHandler(object): self.clear_header(h) -RequestHandlerType = TypeVar("RequestHandlerType", bound=RequestHandler) +_RequestHandlerType = TypeVar("_RequestHandlerType", bound=RequestHandler) -def stream_request_body(cls: Type[RequestHandlerType]) -> Type[RequestHandlerType]: +def stream_request_body(cls: Type[_RequestHandlerType]) -> Type[_RequestHandlerType]: """Apply to `RequestHandler` subclasses to enable streaming body support. This decorator implies the following changes: