Update lzma import to include calibre >= 4.6.0

This commit is contained in:
Carson Gaspar 2020-01-04 05:20:16 -08:00
parent b71ed3887e
commit fc6f830088

View File

@ -21,7 +21,12 @@ from Crypto.Cipher import AES
from Crypto.Util.py3compat import bchr, bord from Crypto.Util.py3compat import bchr, bord
try: try:
# lzma library from calibre 4.6.0 or later
import calibre_lzma.lzma1 as calibre_lzma
except ImportError:
calibre_lzma = None
# lzma library from calibre 2.35.0 or later # lzma library from calibre 2.35.0 or later
try:
import lzma.lzma1 as calibre_lzma import lzma.lzma1 as calibre_lzma
except ImportError: except ImportError:
calibre_lzma = None calibre_lzma = None