diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2011-10-28 12:52:29 (GMT) |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2011-10-28 12:52:29 (GMT) |
commit | aabbda5354407cfe35097c7f17717a716a3d80c4 (patch) | |
tree | e15e7fe42975e08e567879ec8a949d4986ca4493 /Lib/encodings | |
parent | ac73b0c95e352563ecf0a4643b30215b9bdee1a5 (diff) | |
parent | 5d1155c08edf7f53eca804b2b6538636c2dfe711 (diff) | |
download | cpython-aabbda5354407cfe35097c7f17717a716a3d80c4.zip cpython-aabbda5354407cfe35097c7f17717a716a3d80c4.tar.gz cpython-aabbda5354407cfe35097c7f17717a716a3d80c4.tar.bz2 |
Merge 3.2
Diffstat (limited to 'Lib/encodings')
-rw-r--r-- | Lib/encodings/__init__.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/encodings/__init__.py b/Lib/encodings/__init__.py index b189bd9..8dd7130 100644 --- a/Lib/encodings/__init__.py +++ b/Lib/encodings/__init__.py @@ -120,12 +120,11 @@ def search_function(encoding): if not 4 <= len(entry) <= 7: raise CodecRegistryError('module "%s" (%s) failed to register' % (mod.__name__, mod.__file__)) - 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__')): + 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])): raise CodecRegistryError('incompatible codecs in module "%s" (%s)' % (mod.__name__, mod.__file__)) if len(entry)<7 or entry[6] is None: |