mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3: use correct __next__ method
I'm not sure why this is storing a seemingly unused method-wrapper object, but it needs to use the correctly named one on python2/python3.
This commit is contained in:
parent
aa44bf1cd1
commit
457eea7407
@ -31,7 +31,7 @@ from calibre.ebooks.oeb.polish.utils import extract, guess_type
|
|||||||
from calibre.utils.logging import default_log
|
from calibre.utils.logging import default_log
|
||||||
from calibre.utils.short_uuid import uuid4
|
from calibre.utils.short_uuid import uuid4
|
||||||
from polyglot.binary import as_base64_unicode as encode_component, from_base64_unicode as decode_component
|
from polyglot.binary import as_base64_unicode as encode_component, from_base64_unicode as decode_component
|
||||||
from polyglot.builtins import iteritems, map, unicode_type
|
from polyglot.builtins import iteritems, map, is_py3, unicode_type
|
||||||
from polyglot.urllib import quote, urlparse
|
from polyglot.urllib import quote, urlparse
|
||||||
|
|
||||||
RENDER_VERSION = 1
|
RENDER_VERSION = 1
|
||||||
@ -501,6 +501,9 @@ def html_as_dict(root):
|
|||||||
if child.tag.partition('}')[-1] not in ('head', 'body'):
|
if child.tag.partition('}')[-1] not in ('head', 'body'):
|
||||||
root.remove(child)
|
root.remove(child)
|
||||||
root.text = root.tail = None
|
root.text = root.tail = None
|
||||||
|
if is_py3:
|
||||||
|
nsmap = defaultdict(count().__next__)
|
||||||
|
else:
|
||||||
nsmap = defaultdict(count().next)
|
nsmap = defaultdict(count().next)
|
||||||
nsmap[XHTML_NS]
|
nsmap[XHTML_NS]
|
||||||
tags = [serialize_elem(root, nsmap)]
|
tags = [serialize_elem(root, nsmap)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user