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

@ -705,7 +705,7 @@ class Option:
def _check_callback(self):
if self.action == "callback":
if not hasattr(self.callback, '__call__'):
if not callable(self.callback):
raise OptionError(
"callback not callable: %r" % self.callback, self)
if (self.callback_args is not None and