diff --git a/src/calibre/ebooks/chardet.py b/src/calibre/ebooks/chardet.py index 52f4824528..7d016c8bda 100644 --- a/src/calibre/ebooks/chardet.py +++ b/src/calibre/ebooks/chardet.py @@ -109,14 +109,7 @@ _CHARSET_ALIASES = {"macintosh" : "mac-roman", "x-sjis" : "shift-jis"} def detect(bytestring): if isinstance(bytestring, str): bytestring = bytestring.encode('utf-8', 'replace') - try: - from calibre_extensions.uchardet import detect as implementation - except ImportError: - # People running from source without updated binaries - from cchardet import detect as cdi - - def implementation(x): - return cdi(x).get('encoding') or '' + from calibre_extensions.uchardet import detect as implementation enc = implementation(bytestring).lower() return {'encoding': enc, 'confidence': 1 if enc else 0}