Commit 96d9ae5b by Sheng

Use JSONDecodeError

parent a8935079
......@@ -18,6 +18,11 @@ try:
except ImportError:
from tornado.concurrent import Future
try:
from json.decoder import JSONDecodeError
except ImportError:
JSONDecodeError = ValueError
DELAY = 3
......@@ -204,9 +209,7 @@ class WsockHandler(MixinHandler, tornado.websocket.WebSocketHandler):
worker = self.worker_ref()
try:
msg = json.loads(message)
except ValueError: # py2
return
except json.decoder.JSONDecodeError: # py3
except JSONDecodeError:
return
if not isinstance(msg, dict):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment