mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-06 18:54:48 +01:00
Handle passing str to json_loads
This commit is contained in:
parent
7d7731f5d0
commit
dc4c444a71
1 changed files with 3 additions and 1 deletions
|
|
@ -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…
Reference in a new issue