Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webssh
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郑天保
webssh
Commits
96d9ae5b
Commit
96d9ae5b
authored
May 26, 2018
by
Sheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use JSONDecodeError
parent
a8935079
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
handler.py
webssh/handler.py
+6
-3
No files found.
webssh/handler.py
View file @
96d9ae5b
...
...
@@ -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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment