]> granicus.if.org Git - python/commitdiff
Remove a use of callable() in fileinput to silence a -3 warning.
authorBrett Cannon <bcannon@gmail.com>
Sun, 3 Aug 2008 23:52:32 +0000 (23:52 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sun, 3 Aug 2008 23:52:32 +0000 (23:52 +0000)
Lib/fileinput.py

index 19932ca8e64f1cd8da079795f1b2d950f8a7bf94..ba48575209295f1e3da4b34bf975211474b2efbc 100644 (file)
@@ -226,7 +226,7 @@ class FileInput:
         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