update: support working with old versions of PIL/Pillow

Image.close() was added in Pillow 2.4 or so.
This commit is contained in:
Hans-Christoph Steiner 2017-12-20 11:38:54 +01:00
parent 9087ec76f3
commit 2659312a7c

View 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']: