diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-10-09 22:05:45 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-10-09 22:05:45 (GMT) |
commit | de0559998fef231efc9ecbdef5b3a195d4eaa28d (patch) | |
tree | 235b05866ae52f80d81f2953c663d74f1de6dae1 /Lib/encodings | |
parent | 0c8bee639368324b750176ee171cadd33847f18e (diff) | |
download | cpython-de0559998fef231efc9ecbdef5b3a195d4eaa28d.zip cpython-de0559998fef231efc9ecbdef5b3a195d4eaa28d.tar.gz cpython-de0559998fef231efc9ecbdef5b3a195d4eaa28d.tar.bz2 |
replace callable()
Diffstat (limited to 'Lib/encodings')
-rw-r--r-- | Lib/encodings/__init__.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/encodings/__init__.py b/Lib/encodings/__init__.py index aea7c5e..7945530 100644 --- a/Lib/encodings/__init__.py +++ b/Lib/encodings/__init__.py @@ -123,12 +123,12 @@ def search_function(encoding): raise CodecRegistryError,\ 'module "%s" (%s) failed to register' % \ (mod.__name__, mod.__file__) - if not callable(entry[0]) or \ - not callable(entry[1]) or \ - (entry[2] is not None and not callable(entry[2])) or \ - (entry[3] is not None and not callable(entry[3])) or \ - (len(entry) > 4 and entry[4] is not None and not callable(entry[4])) or \ - (len(entry) > 5 and entry[5] is not None and not callable(entry[5])): + if not hasattr(entry[0], '__call__') or \ + not hasattr(entry[1], '__call__') or \ + (entry[2] is not None and not hasattr(entry[2], '__call__')) or \ + (entry[3] is not None and not hasattr(entry[3], '__call__')) or \ + (len(entry) > 4 and entry[4] is not None and not hasattr(entry[4], '__call__')) or \ + (len(entry) > 5 and entry[5] is not None and not hasattr(entry[5], '__call__')): raise CodecRegistryError,\ 'incompatible codecs in module "%s" (%s)' % \ (mod.__name__, mod.__file__) |