mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Embedded content server: Ignore corrupted settings files
This commit is contained in:
parent
d8d1d890ea
commit
e5b034b8c5
@ -6,6 +6,7 @@
|
||||
import errno
|
||||
import json
|
||||
import os
|
||||
from contextlib import suppress
|
||||
from threading import Thread
|
||||
|
||||
from calibre import as_unicode
|
||||
@ -32,7 +33,8 @@ def read_json(path):
|
||||
if err.errno != errno.ENOENT:
|
||||
raise
|
||||
return
|
||||
return json.loads(raw)
|
||||
with suppress(json.JSONDecodeError):
|
||||
return json.loads(raw)
|
||||
|
||||
|
||||
def custom_list_template():
|
||||
|
Loading…
x
Reference in New Issue
Block a user