From ce5a6e8b784c259770f0b7b4ae3ce755c8cc16ea Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 26 Sep 2023 19:52:03 -0400 Subject: [PATCH] drop fallback for people running from source with calibre 6.1 --- src/calibre/ebooks/chardet.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) 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}