mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-02 10:53:10 +03:00
py3k: Remove callable() function
callable(c) is isinstance(x, collections.Callable) in py3k.
This commit is contained in:
parent
718dbcc8ca
commit
b386ed14dd
|
@ -71,6 +71,7 @@ import os, sys
|
||||||
|
|
||||||
# type stuff
|
# type stuff
|
||||||
from types import IntType, StringType, TupleType
|
from types import IntType, StringType, TupleType
|
||||||
|
import collections
|
||||||
|
|
||||||
try:
|
try:
|
||||||
UnicodeStringType = type(unicode(""))
|
UnicodeStringType = type(unicode(""))
|
||||||
|
@ -802,7 +803,7 @@ class Image:
|
||||||
|
|
||||||
self.load()
|
self.load()
|
||||||
|
|
||||||
if callable(filter):
|
if isinstance(filter, collections.Callable):
|
||||||
filter = filter()
|
filter = filter()
|
||||||
if not hasattr(filter, "filter"):
|
if not hasattr(filter, "filter"):
|
||||||
raise TypeError("filter argument should be ImageFilter.Filter instance or class")
|
raise TypeError("filter argument should be ImageFilter.Filter instance or class")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user