py3: more fixes

This commit is contained in:
Kovid Goyal 2019-08-07 22:35:58 +05:30
parent 5e7c625685
commit 69ea54fa15
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 2 additions and 1 deletions

View File

@ -498,6 +498,7 @@ def strftime(fmt, t=None):
t = list(t)
orig_year = t[0]
t[0] = replacement
t = time.struct_time(t)
ans = None
if iswindows:
if isinstance(fmt, bytes):

View File

@ -38,7 +38,7 @@ class APNXBuilder(object):
with lopen(mobi_file_path, 'rb') as mf:
ident = PdbHeaderReader(mf).identity()
if ident != b'BOOKMOBI':
if as_bytes(ident) != b'BOOKMOBI':
# Check that this is really a MOBI file.
raise Exception(_('Not a valid MOBI file. Reports identity of %s') % ident)
apnx_meta['acr'] = as_unicode(PdbHeaderReader(mf).name(), errors='replace')