mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Forgot to also catch attributeerror for people running from source
This commit is contained in:
parent
78d048c809
commit
1c82942ed8
@ -761,7 +761,7 @@ def html_as_json(root):
|
|||||||
ensure_body(root)
|
ensure_body(root)
|
||||||
try:
|
try:
|
||||||
serialize = plugins['html_as_json'][0].serialize
|
serialize = plugins['html_as_json'][0].serialize
|
||||||
except KeyError:
|
except (KeyError, AttributeError):
|
||||||
return as_bytes(json.dumps(html_as_dict(root), ensure_ascii=False, separators=(',', ':')))
|
return as_bytes(json.dumps(html_as_dict(root), ensure_ascii=False, separators=(',', ':')))
|
||||||
for child in tuple(root.iterchildren('*')):
|
for child in tuple(root.iterchildren('*')):
|
||||||
if child.tag.partition('}')[-1] not in ('head', 'body'):
|
if child.tag.partition('}')[-1] not in ('head', 'body'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user