From ea5b6da55acd42f8f59970ab51d7cd585e8a1b56 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 27 Apr 2019 13:15:24 +0530 Subject: [PATCH] Get rid of workaround for people running from source with obsolete binaries --- src/calibre/utils/html2text.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/calibre/utils/html2text.py b/src/calibre/utils/html2text.py index 9cffa2f951..ecb5ddbe35 100644 --- a/src/calibre/utils/html2text.py +++ b/src/calibre/utils/html2text.py @@ -5,22 +5,8 @@ from __future__ import (unicode_literals, division, absolute_import, print_function) -def rudimentary_html2text(html): - from lxml import html as h - root = h.fromstring(html) - return h.tostring(root, method='text', encoding='unicode') - - def html2text(html): - try: - from html2text import HTML2Text - except ImportError: - # for people running from source - from calibre.constants import numeric_version - if numeric_version <= (3, 40, 1): - return rudimentary_html2text(html) - raise - + from html2text import HTML2Text import re if isinstance(html, bytes): from calibre.ebooks.chardet import xml_to_unicode