Browse Source

images2gif: PILLOW_VERSION is obsolete (#899)

Relates to #827.
Anna Petrasova 4 years ago
parent
commit
7df171ac68
1 changed files with 3 additions and 3 deletions
  1. 3 3
      lib/python/imaging/images2gif.py

+ 3 - 3
lib/python/imaging/images2gif.py

@@ -73,8 +73,8 @@ try:
     from PIL import Image
     pillow = True
     try:
-        from PIL import PILLOW_VERSION  # test if user has Pillow or PIL
-    except ImportError:
+        PIL.__version__  # test if user has Pillow or PIL
+    except AttributeError:
         pillow = False
     from PIL.GifImagePlugin import getheader, getdata
 except ImportError:
@@ -495,7 +495,7 @@ def writeGif(filename, images, duration=0.1, repeat=True, **kwargs):
     """
     if pillow:
         # Pillow >= 3.4.0 has animated GIF writing
-        version = [int(i) for i in PILLOW_VERSION.split('.')]
+        version = [int(i) for i in PIL.__version__.split('.')]
         if version[0] > 3 or (version[0] == 3 and version[1] >= 4):
             writeGifPillow(filename, images, duration, repeat)
             return