diff --git a/searx/engines/framalibre.py b/searx/engines/framalibre.py index 146cdaee..f3441fa5 100644 --- a/searx/engines/framalibre.py +++ b/searx/engines/framalibre.py @@ -10,7 +10,10 @@ @parse url, title, content, thumbnail, img_src """ -from cgi import escape +try: + from cgi import escape +except: + from html import escape from lxml import html from searx.engines.xpath import extract_text from searx.url_utils import urljoin, urlencode diff --git a/searx/webapp.py b/searx/webapp.py index 3bb29140..183bf197 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -41,7 +41,10 @@ except: logger.critical("cannot import dependency: pygments") from sys import exit exit(1) -from cgi import escape +try: + from cgi import escape +except: + from html import escape from datetime import datetime, timedelta from time import time from werkzeug.contrib.fixers import ProxyFix