Forgot to also catch attributeerror for people running from source

This commit is contained in:
Kovid Goyal 2019-10-31 22:44:16 +05:30
parent 78d048c809
commit 1c82942ed8
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -761,7 +761,7 @@ def html_as_json(root):
ensure_body(root)
try:
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=(',', ':')))
for child in tuple(root.iterchildren('*')):
if child.tag.partition('}')[-1] not in ('head', 'body'):