From 8e5704683c43ed5e9ab02de87afc16ea3ec183b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Tue, 4 Aug 2015 09:54:39 +0200 Subject: [PATCH] Fixed detection of file corruption --- kcc/comic2ebook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py index 06a1c61..ce4cfa6 100755 --- a/kcc/comic2ebook.py +++ b/kcc/comic2ebook.py @@ -986,7 +986,7 @@ def detectCorruption(tmpPath, orgPath): imageSmaller += 1 except Exception as err: rmtree(os.path.join(tmpPath, '..', '..'), True) - if 'decoder' in err and 'not available' in err: + if 'decoder' in str(err) and 'not available' in str(err): raise RuntimeError('Pillow was compiled without JPG and/or PNG decoder.') else: raise RuntimeError('Image file %s is corrupted.' % pathOrg)