mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Handle passing str to json_loads
This commit is contained in:
parent
7d7731f5d0
commit
dc4c444a71
@ -62,7 +62,9 @@ def json_dumps(obj):
|
||||
|
||||
def json_loads(raw):
|
||||
import json
|
||||
return json.loads(raw.decode('utf-8'), object_hook=from_json)
|
||||
if isinstance(raw, bytes):
|
||||
raw = raw.decode('utf-8')
|
||||
return json.loads(raw, object_hook=from_json)
|
||||
|
||||
|
||||
def make_config_dir():
|
||||
|
Loading…
x
Reference in New Issue
Block a user