From 74f751037f806edd8cd506fd95e33c6bfbee1cf9 Mon Sep 17 00:00:00 2001 From: "Matt R. Wilson" Date: Mon, 17 Oct 2016 11:45:54 -0400 Subject: [PATCH] Divide floats to eliminate deprecation warning. When running python 2.7 with the `-3` flag the following warning occurs > .../PIL/Image.py:48: DeprecationWarning: classic int division MAX_IMAGE_PIXELS = int(1024 * 1024 * 1024 / 4 / 3) Simply changing the 4 and 3 to be floats instead eliminates the warning and, because the result is cast, the resulting `int` stays the same for python 2 and 3. --- PIL/Image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PIL/Image.py b/PIL/Image.py index a23a7d92c..fa743c602 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -46,7 +46,7 @@ class _imaging_not_installed(object): # Limit to around a quarter gigabyte for a 24 bit (3 bpp) image -MAX_IMAGE_PIXELS = int(1024 * 1024 * 1024 / 4 / 3) +MAX_IMAGE_PIXELS = int(1024 * 1024 * 1024 // 4 // 3) try: # give Tk a chance to set up the environment, in case we're