From 85157815640fb44f4186e98416ebdadd43bbec8b Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Mon, 30 Nov 2020 18:32:21 +0100 Subject: [PATCH] Fix #1727 (import rarfile 4.0 fails on python3.5) --- cps/admin.py | 2 +- cps/comic.py | 4 ++-- optional-requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cps/admin.py b/cps/admin.py index fe2769e2..b30d1607 100644 --- a/cps/admin.py +++ b/cps/admin.py @@ -55,7 +55,7 @@ feature_support = { try: import rarfile feature_support['rar'] = True -except ImportError: +except (ImportError, SyntaxError): feature_support['rar'] = False try: diff --git a/cps/comic.py b/cps/comic.py index c228454c..7e3c7d47 100644 --- a/cps/comic.py +++ b/cps/comic.py @@ -38,7 +38,7 @@ try: use_comic_meta = True try: from comicapi import __version__ as comic_version - except (ImportError): + except ImportError: comic_version = '' except (ImportError, LookupError) as e: log.debug('Cannot import comicapi, extracting comic metadata will not work: %s', e) @@ -47,7 +47,7 @@ except (ImportError, LookupError) as e: try: import rarfile use_rarfile = True - except ImportError as e: + except (ImportError, SyntaxError) as e: log.debug('Cannot import rarfile, extracting cover files from rar files will not work: %s', e) use_rarfile = False use_comic_meta = False diff --git a/optional-requirements.txt b/optional-requirements.txt index ae35f389..0d670875 100644 --- a/optional-requirements.txt +++ b/optional-requirements.txt @@ -31,7 +31,7 @@ rarfile>=2.7 # other natsort>=2.2.0,<7.1.0 -git+https://github.com/OzzieIsaacs/comicapi.git@b323fab55e7daba97f90bf59a4bc8de9d9c0a86b#egg=comicapi +git+https://github.com/OzzieIsaacs/comicapi.git@7aa91ea95ea7a919df6c6cac817865434a31c228#egg=comicapi #Kobo integration jsonschema>=3.2.0,<3.3.0