import jsondecodeerror seperately since its not in ujson
This commit is contained in:
parent
919ab12b76
commit
39d0be32ac
6 changed files with 15 additions and 9 deletions
|
@ -4,6 +4,7 @@ HTTP endpoints for communicating with peers
|
|||
"""
|
||||
import sys
|
||||
import os
|
||||
from json import JSONDecodeError
|
||||
|
||||
import deadsimplekv as simplekv
|
||||
import ujson as json
|
||||
|
@ -50,7 +51,7 @@ def sendto():
|
|||
"""Endpoint peers send chat messages to"""
|
||||
try:
|
||||
msg = request.get_json(force=True)
|
||||
except json.JSONDecodeError:
|
||||
except JSONDecodeError:
|
||||
msg = ''
|
||||
else:
|
||||
msg = json.dumps(msg)
|
||||
|
|
|
@ -32,7 +32,7 @@ with open(
|
|||
os.path.dirname(
|
||||
os.path.realpath(__file__)) + '/info.json', 'r') as info_file:
|
||||
data = info_file.read().strip()
|
||||
version = json.loads(data, strict=False)['version']
|
||||
version = json.loads(data)['version']
|
||||
|
||||
BOARD_CACHE_FILE = identifyhome.identify_home() + '/board-index.cache.json'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue