py3: make Check Book work

when working with lxml.etree strings, everything is explicitly bytes
This commit is contained in:
Eli Schwartz 2019-04-22 22:33:19 -04:00
parent 570b02c59b
commit adbe76079e
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6

View File

@ -370,7 +370,7 @@ def check_opf(container):
errors.append(IncorrectCover(container.opf_name, cover.sourceline, cover.get('content', ''))) errors.append(IncorrectCover(container.opf_name, cover.sourceline, cover.get('content', '')))
raw = etree.tostring(cover) raw = etree.tostring(cover)
try: try:
n, c = raw.index('name="'), raw.index('content="') n, c = raw.index(b'name="'), raw.index(b'content="')
except ValueError: except ValueError:
n = c = -1 n = c = -1
if n > -1 and c > -1 and n > c: if n > -1 and c > -1 and n > c: