This commit is contained in:
Jakob Ketterl
2019-05-09 20:11:21 +02:00
parent 6eb37b989f
commit bd627d77b7
2 changed files with 3 additions and 2 deletions

View File

@ -29,7 +29,8 @@ class WebSocketConnection(object):
def send(self, data):
# convenience
if (type(data) == dict):
data = json.dumps(data)
# allow_nan = False disallows NaN and Infinty to be encoded. Browser JSON will not parse them anyway.
data = json.dumps(data, allow_nan = False)
# string-type messages are sent as text frames
if (type(data) == str):