"""#"
-import codecs,aliases
+import codecs,aliases,exceptions
_cache = {}
_unknown = '--unknown--'
+class CodecRegistryError(exceptions.LookupError,
+ exceptions.SystemError):
+ pass
+
def search_function(encoding):
# Cache lookup
except AttributeError:
entry = ()
if len(entry) != 4:
- raise SystemError,\
- 'module "%s.%s" failed to register' % \
- (__name__,modname)
+ raise CodecRegistryError,\
+ 'module "%s" (%s) failed to register' % \
+ (mod.__name__, mod.__file__)
for obj in entry:
if not callable(obj):
- raise SystemError,\
- 'incompatible codecs in module "%s.%s"' % \
- (__name__,modname)
+ raise CodecRegistryError,\
+ 'incompatible codecs in module "%s" (%s)' % \
+ (mod.__name__, mod.__file__)
# Cache the codec registry entry
_cache[encoding] = entry