Commit 5e5ff0cb authored by lorddavidiii's avatar lorddavidiii

webapp.py: use html.escape if cgi.escape is not available

- cgi.escape was removed in python 3.8
- also use html.escape in framalibre.py
parent 42d5e2c0
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment