summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2019-11-28 19:31:59 +0000
committerGitHub <noreply@github.com>2019-11-28 19:31:59 +0000
commit789d71350d0348e43eb158995bfabc47f50915a6 (patch)
treed4435f60e385b6eaa7a37cc8a603ab2fcc1c5fd2
parent05033ea8d8d3b3afb92c614a86399a499e7ad07e (diff)
parent5e5ff0cbf83fc6929545e1ca3f936a162019a2aa (diff)
downloadsearxng-789d71350d0348e43eb158995bfabc47f50915a6.tar.gz
searxng-789d71350d0348e43eb158995bfabc47f50915a6.zip
Merge pull request #1745 from lorddavidiii/python3.8-fix
Fix python 3.8 compatibility
-rw-r--r--searx/engines/framalibre.py5
-rw-r--r--searx/webapp.py5
2 files changed, 8 insertions, 2 deletions
diff --git a/searx/engines/framalibre.py b/searx/engines/framalibre.py
index 146cdaeec..f3441fa5f 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 3bb29140a..183bf1975 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