From e932d0d53cf8a545550fe29ffd88bfdb3b05e7a4 Mon Sep 17 00:00:00 2001 From: agnewee Date: Thu, 20 Aug 2020 20:53:16 +0800 Subject: [PATCH] Update websocket.py --- tornado/websocket.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tornado/websocket.py b/tornado/websocket.py index 3db5b10b48..ca035138d0 100644 --- a/tornado/websocket.py +++ b/tornado/websocket.py @@ -1450,7 +1450,7 @@ def on_ws_connection_close( self.on_connection_close() def _on_http_response(self, response: httpclient.HTTPResponse) -> None: - if self.connect_future and not self.connect_future.done(): + if not self.connect_future.done(): if response.error: self.connect_future.set_exception(response.error) else: