[Python-checkins] r65524 - python/trunk/Lib/pickle.py

brett.cannon python-checkins at python.org
Mon Aug 4 23:34:34 CEST 2008


Author: brett.cannon
Date: Mon Aug  4 23:34:34 2008
New Revision: 65524

Log:
Remove use of callable() from pickle to silence warnings under -3.


Modified:
   python/trunk/Lib/pickle.py

Modified: python/trunk/Lib/pickle.py
==============================================================================
--- python/trunk/Lib/pickle.py	(original)
+++ python/trunk/Lib/pickle.py	Mon Aug  4 23:34:34 2008
@@ -351,7 +351,7 @@
             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


More information about the Python-checkins mailing list