import jsondecodeerror seperately since its not in ujson

This commit is contained in:
Kevin Froman 2020-04-03 04:33:30 -05:00
parent 919ab12b76
commit 39d0be32ac
6 changed files with 15 additions and 9 deletions

View file

@ -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)

View file

@ -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'