chiark / gitweb /
update: support working with old versions of PIL/Pillow
authorHans-Christoph Steiner <hans@eds.org>
Wed, 20 Dec 2017 10:38:54 +0000 (11:38 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Wed, 20 Dec 2017 22:46:37 +0000 (23:46 +0100)
Image.close() was added in Pillow 2.4 or so.

fdroidserver/update.py

index 3015e337ca6325813337e1a8c6bb6dd66a7f4178..c1079489cc8f08020d03f26f1bd7f58bcde4decc 100644 (file)
@@ -1492,7 +1492,7 @@ def extract_apk_icons(icon_filename, apk, apkzip, repo_dir):
             logging.warning(_("Failed reading {path}: {error}")
                             .format(path=icon_path, error=e))
         finally:
-            if im:
+            if im and hasattr(im, 'close'):
                 im.close()
 
     if apk['icons']: