]> granicus.if.org Git - python/commitdiff
Remove use of callable() from pickle to silence warnings under -3.
authorBrett Cannon <bcannon@gmail.com>
Mon, 4 Aug 2008 21:34:34 +0000 (21:34 +0000)
committerBrett Cannon <bcannon@gmail.com>
Mon, 4 Aug 2008 21:34:34 +0000 (21:34 +0000)
Lib/pickle.py

index 02a1b1d1ae8cadca74a6a28b10fb5dedf875d178..9667781a8c3ccdaa70533db1e11d476ddbae710b 100644 (file)
@@ -351,7 +351,7 @@ class Pickler:
             raise PicklingError("args from reduce() should be a tuple")
 
         # Assert that func is callable
-        if not callable(func):
+        if not hasattr(func, '__call__'):
             raise PicklingError("func from reduce should be callable")
 
         save = self.save