From: Eugene Toder Date: Tue, 3 Nov 2020 03:04:00 +0000 (-0500) Subject: Remove WebSocketHandler.stream. X-Git-Tag: v6.2.0b1~51^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05e905ed3284744bc4ca40708d9de65f472637e7;p=thirdparty%2Ftornado.git Remove WebSocketHandler.stream. It was no longer used and always set to None. --- diff --git a/tornado/websocket.py b/tornado/websocket.py index d2c6a427a..dfa36554b 100644 --- a/tornado/websocket.py +++ b/tornado/websocket.py @@ -225,7 +225,6 @@ class WebSocketHandler(tornado.web.RequestHandler): self.ws_connection = None # type: Optional[WebSocketProtocol] self.close_code = None # type: Optional[int] self.close_reason = None # type: Optional[str] - self.stream = None # type: Optional[IOStream] self._on_close_called = False async def get(self, *args: Any, **kwargs: Any) -> None: @@ -584,16 +583,6 @@ class WebSocketHandler(tornado.web.RequestHandler): if self.get_status() != 101 or self._on_close_called: super()._break_cycles() - def send_error(self, *args: Any, **kwargs: Any) -> None: - if self.stream is None: - super().send_error(*args, **kwargs) - else: - # If we get an uncaught exception during the handshake, - # we have no choice but to abruptly close the connection. - # TODO: for uncaught exceptions after the handshake, - # we can close the connection more gracefully. - self.stream.close() - def get_websocket_protocol(self) -> Optional["WebSocketProtocol"]: websocket_version = self.request.headers.get("Sec-WebSocket-Version") if websocket_version in ("7", "8", "13"):