Closes #13258: Use callable() built-in in the standard library.

This commit is contained in:
Florent Xicluna 2011-10-28 14:45:05 +02:00
parent f99e4b5dbe
commit 5d1155c08e
25 changed files with 48 additions and 51 deletions

View file

@ -225,10 +225,11 @@ class FileInput:
raise ValueError("FileInput opening mode must be one of "
"'r', 'rU', 'U' and 'rb'")
self._mode = mode
if inplace and openhook:
raise ValueError("FileInput cannot use an opening hook in inplace mode")
elif openhook and not hasattr(openhook, '__call__'):
raise ValueError("FileInput openhook must be callable")
if openhook:
if inplace:
raise ValueError("FileInput cannot use an opening hook in inplace mode")
if not callable(openhook):
raise ValueError("FileInput openhook must be callable")
self._openhook = openhook
def __del__(self):