From b386ed14dd1ed800762d0c11e10d991061c7fbab Mon Sep 17 00:00:00 2001 From: Brian Crowell Date: Mon, 15 Oct 2012 15:47:53 -0500 Subject: [PATCH] py3k: Remove callable() function callable(c) is isinstance(x, collections.Callable) in py3k. --- PIL/Image.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PIL/Image.py b/PIL/Image.py index 7f2ea381d..6d62f5918 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -71,6 +71,7 @@ import os, sys # type stuff from types import IntType, StringType, TupleType +import collections try: UnicodeStringType = type(unicode("")) @@ -802,7 +803,7 @@ class Image: self.load() - if callable(filter): + if isinstance(filter, collections.Callable): filter = filter() if not hasattr(filter, "filter"): raise TypeError("filter argument should be ImageFilter.Filter instance or class")