From af94e2d93d0657a0df84fbbf60ed0b40cfbd5866 Mon Sep 17 00:00:00 2001 From: Brian Crowell Date: Tue, 16 Oct 2012 22:54:38 -0500 Subject: [PATCH] py3k: Map long type to int int() is really now long() in py3k, but to avoid breaking 2.6/2.7, we leave the integer types where they are and just map long to int in py3k. Also, pretty proud of myself for finding an easy way of detecting py3k. --- PIL/OleFileIO.py | 3 +++ PIL/WmfImagePlugin.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/PIL/OleFileIO.py b/PIL/OleFileIO.py index 7fb45f077..db1c04f06 100644 --- a/PIL/OleFileIO.py +++ b/PIL/OleFileIO.py @@ -41,6 +41,9 @@ from __future__ import print_function import io import sys +if str != bytes: + long = int + def i16(c, o = 0): return ord(c[o])+(ord(c[o+1])<<8) diff --git a/PIL/WmfImagePlugin.py b/PIL/WmfImagePlugin.py index 93124be23..ca3f194a9 100644 --- a/PIL/WmfImagePlugin.py +++ b/PIL/WmfImagePlugin.py @@ -21,6 +21,9 @@ from . import Image, ImageFile _handler = None +if str != bytes: + long = int + ## # Install application-specific WMF image handler. #