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,12 +4,14 @@ send a command to the local API server
|
|||
"""
|
||||
import urllib
|
||||
import time
|
||||
import functools
|
||||
from typing import TYPE_CHECKING, Callable
|
||||
|
||||
import requests
|
||||
import deadsimplekv
|
||||
|
||||
import logger
|
||||
import config
|
||||
|
||||
import logger, config, deadsimplekv
|
||||
from . import getclientapiserver
|
||||
import filepaths
|
||||
"""
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
validate new block's metadata
|
||||
"""
|
||||
from json import JSONDecodeError
|
||||
import ujson as json
|
||||
|
||||
import logger, onionrexceptions
|
||||
|
@ -34,7 +35,7 @@ def validate_metadata(metadata, block_data) -> bool:
|
|||
if type(metadata) is str:
|
||||
try:
|
||||
metadata = json.loads(metadata)
|
||||
except json.JSONDecodeError:
|
||||
except JSONDecodeError:
|
||||
pass
|
||||
|
||||
# Validate metadata dict for invalid keys to sizes that are too large
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue