[Python-checkins] r65455 - python/trunk/Lib/fileinput.py

brett.cannon python-checkins at python.org
Mon Aug 4 01:52:33 CEST 2008


Author: brett.cannon
Date: Mon Aug  4 01:52:32 2008
New Revision: 65455

Log:
Remove a use of callable() in fileinput to silence a -3 warning.


Modified:
   python/trunk/Lib/fileinput.py

Modified: python/trunk/Lib/fileinput.py
==============================================================================
--- python/trunk/Lib/fileinput.py	(original)
+++ python/trunk/Lib/fileinput.py	Mon Aug  4 01:52:32 2008
@@ -226,7 +226,7 @@
         self._mode = mode
         if inplace and openhook:
             raise ValueError("FileInput cannot use an opening hook in inplace mode")
-        elif openhook and not callable(openhook):
+        elif openhook and not hasattr(openhook, '__call__'):
             raise ValueError("FileInput openhook must be callable")
         self._openhook = openhook
 


More information about the Python-checkins mailing list