From bf116788aa0c1e2e43b6bc55a63c1b5ab8aaa8b3 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Mon, 7 Feb 2022 21:20:47 -0500 Subject: [PATCH] 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. --- docs/conf.py | 1 + tornado/web.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) 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: -- 2.47.2