Skip to content

Commit

Permalink
fix: Fix compatibility with Tornado 6.0
Browse files Browse the repository at this point in the history
When set_nodelay is called from the WebsocketHandler.open method in Tornado 6.0,
it results in an assertion failure.  This change introduces a workaround.
  • Loading branch information
jbms committed Mar 3, 2019
1 parent e271551 commit 23861ac
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion beancount_import/webserver.py
Expand Up @@ -264,7 +264,12 @@ def post(self):
class WebSocketHandler(tornado.websocket.WebSocketHandler):
def open(self, *args):
self.application.socket_clients.add(self)
self.set_nodelay(True)
try:
self.set_nodelay(True)
except:
# This results in an assertion error in Tornado 6.0. Simply ignore
# it since the nodelay option isn't critical.
pass
self.prev_state = dict()
self.prev_state_generation = dict()
self.watched_files = set()
Expand Down

0 comments on commit 23861ac

Please sign in to comment.