File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ async def recv() -> Any:
196196 ConnectionContext (
197197 self ._component_constructor (),
198198 value = Connection (
199- scope = WSGIContainer .environ (self .request ),
199+ scope = _FAKE_WSGI_CONTAINER .environ (self .request ),
200200 location = Location (
201201 pathname = f"/{ path [len (self ._url_prefix ):]} " ,
202202 search = (
@@ -222,3 +222,10 @@ async def on_message(self, message: str | bytes) -> None:
222222 def on_close (self ) -> None :
223223 if not self ._dispatch_future .done ():
224224 self ._dispatch_future .cancel ()
225+
226+
227+ # The interface for WSGIContainer.environ changed in Tornado version 6.3 from
228+ # a staticmethod to an instance method. Since we're not that concerned with
229+ # the details of the WSGI app itself, we can just use a fake one.
230+ # see: https://github.com/tornadoweb/tornado/pull/3231#issuecomment-1518957578
231+ _FAKE_WSGI_CONTAINER = WSGIContainer (lambda * a , ** kw : iter ([]))
You can’t perform that action at this time.
0 commit comments