From 12ce977d7920dfc717075751b62ffa573f3ce649 Mon Sep 17 00:00:00 2001 From: Zhuoyun Wei Date: Wed, 18 Apr 2018 04:58:45 -0400 Subject: [PATCH] Propagate changes --- .../DeDRM.app/Contents/Resources/ion.py | 10 +++++++--- .../DeDRM.app/Contents/Resources/kfxdedrm.py | 4 ++-- .../DeDRM_App/DeDRM_lib/lib/ion.py | 10 +++++++--- .../DeDRM_App/DeDRM_lib/lib/kfxdedrm.py | 4 ++-- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/ion.py b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/ion.py index c100191..40433ca 100644 --- a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/ion.py +++ b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/ion.py @@ -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 diff --git a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/kfxdedrm.py b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/kfxdedrm.py index 8885e09..c2b9bb1 100644 --- a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/kfxdedrm.py +++ b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/kfxdedrm.py @@ -15,9 +15,9 @@ except ImportError: from StringIO import StringIO try: - import ion -except: from calibre_plugins.dedrm import ion +except ImportError: + import ion __license__ = 'GPL v3' diff --git a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/ion.py b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/ion.py index c100191..40433ca 100644 --- a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/ion.py +++ b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/ion.py @@ -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 diff --git a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/kfxdedrm.py b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/kfxdedrm.py index 8885e09..c2b9bb1 100644 --- a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/kfxdedrm.py +++ b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/kfxdedrm.py @@ -15,9 +15,9 @@ except ImportError: from StringIO import StringIO try: - import ion -except: from calibre_plugins.dedrm import ion +except ImportError: + import ion __license__ = 'GPL v3'