Use pylzma as a fallback

This commit is contained in:
Zhuoyun Wei 2018-04-18 04:57:07 -04:00
parent 7b45d2128c
commit 4f1e9fcf43
No known key found for this signature in database
GPG Key ID: AE9C22168EBA0BDB
1 changed files with 7 additions and 3 deletions

View File

@ -23,13 +23,17 @@ from Crypto.Util.py3compat import bchr, bord
try:
# lzma library from calibre 2.35.0 or later
import lzma.lzma1 as calibre_lzma
except:
except ImportError:
calibre_lzma = None
try:
import lzma
except:
except ImportError:
# Need pip backports.lzma on Python <3.3
from backports import lzma
try:
from backports import lzma
except ImportError:
# Windows-friendly choice: pylzma wheels
import pylzma as lzma
TID_NULL = 0