mirror of
https://github.com/apprenticeharper/DeDRM_tools
synced 2024-12-26 09:58:55 +01:00
Merge pull request #971 from cgaspar/master
Update lzma import to include calibre >= 4.6.0
This commit is contained in:
commit
5d8dc595ce
1 changed files with 12 additions and 7 deletions
|
@ -21,19 +21,24 @@ 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 2.35.0 or later
|
# lzma library from calibre 4.6.0 or later
|
||||||
import lzma.lzma1 as calibre_lzma
|
import calibre_lzma.lzma1 as calibre_lzma
|
||||||
except ImportError:
|
except ImportError:
|
||||||
calibre_lzma = None
|
calibre_lzma = None
|
||||||
|
# lzma library from calibre 2.35.0 or later
|
||||||
try:
|
try:
|
||||||
import lzma
|
import lzma.lzma1 as calibre_lzma
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# Need pip backports.lzma on Python <3.3
|
calibre_lzma = None
|
||||||
try:
|
try:
|
||||||
from backports import lzma
|
import lzma
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# Windows-friendly choice: pylzma wheels
|
# Need pip backports.lzma on Python <3.3
|
||||||
import pylzma as lzma
|
try:
|
||||||
|
from backports import lzma
|
||||||
|
except ImportError:
|
||||||
|
# Windows-friendly choice: pylzma wheels
|
||||||
|
import pylzma as lzma
|
||||||
|
|
||||||
|
|
||||||
TID_NULL = 0
|
TID_NULL = 0
|
||||||
|
|
Loading…
Reference in a new issue