Skip to content

Commit f2b7d8b

Browse files
committed
Fix PrerequisitesChecker to properly get Pillow version for newer versions
1 parent 529b539 commit f2b7d8b

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

PrerequisitesCheckerGramplet/PrerequisitesCheckerGramplet.gpr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
id="Prerequisites Checker Gramplet",
2828
name=_("Prerequisites Checker"),
2929
description = _("Prerequisites Checker Gramplet"),
30-
version = '0.8.23',
30+
version = '0.8.24',
3131
gramps_target_version='5.1',
3232
status = STABLE,
3333
fname="PrerequisitesCheckerGramplet.py",

PrerequisitesCheckerGramplet/PrerequisitesCheckerGramplet.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -963,18 +963,20 @@ def check17_pillow(self):
963963
import PIL
964964
# from PIL import Image
965965
try:
966-
#print(dir(PIL))
967-
pil_ver = str(PIL.VERSION)
968-
pillow_ver = str(PIL.PILLOW_VERSION)
969-
#print("Pillow version:" + pillow_ver)
966+
pil_ver = PIL.__version__
970967
except Exception:
971-
pil_ver = "Installed but does not supply version"
972-
pillow_ver = "old version of PIL with no version"
968+
try:
969+
pil_ver = str(PIL.PILLOW_VERSION)
970+
except Exception:
971+
try:
972+
#print(dir(PIL))
973+
pil_ver = str(PIL.VERSION)
974+
except Exception:
975+
pil_ver = "Installed but does not supply version"
973976
except ImportError:
974-
pillow_ver = "Not found"
975977
pil_ver = "Not found"
976978

977-
result = "(PILLOW " + pillow_ver + ")(PIL " + pil_ver + ")"
979+
result = "(PILLOW " + pil_ver + ")"
978980
# End check
979981
self.append_text(result)
980982

0 commit comments

Comments
 (0)