From 6891989274a103c994d960d73b70c1c6e631286b Mon Sep 17 00:00:00 2001 From: Kenny Ostrom Date: Tue, 26 Aug 2014 10:26:25 -0500 Subject: [PATCH] print version numbers on mismatch --- PIL/Image.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PIL/Image.py b/PIL/Image.py index 480410eff..e365f26c9 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -59,9 +59,11 @@ try: # them. Note that other modules should not refer to _imaging # directly; import Image and use the Image.core variable instead. from PIL import _imaging as core - if PILLOW_VERSION != getattr(core, 'PILLOW_VERSION', None): + pillow_version_imported = getattr(core, 'PILLOW_VERSION', None) + if PILLOW_VERSION != pillow_version_imported: raise ImportError("The _imaging extension was built for another " - " version of Pillow or PIL") + " version of Pillow or PIL - " + " expected %s actual %s" % (PILLOW_VERSION, pillow_version_imported)) except ImportError as v: core = _imaging_not_installed()