mirror of https://github.com/searx/searx
Merge pull request #1745 from lorddavidiii/python3.8-fix
Fix python 3.8 compatibility
This commit is contained in:
commit
789d71350d
|
@ -10,7 +10,10 @@
|
||||||
@parse url, title, content, thumbnail, img_src
|
@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 lxml import html
|
||||||
from searx.engines.xpath import extract_text
|
from searx.engines.xpath import extract_text
|
||||||
from searx.url_utils import urljoin, urlencode
|
from searx.url_utils import urljoin, urlencode
|
||||||
|
|
|
@ -41,7 +41,10 @@ except:
|
||||||
logger.critical("cannot import dependency: pygments")
|
logger.critical("cannot import dependency: pygments")
|
||||||
from sys import exit
|
from sys import exit
|
||||||
exit(1)
|
exit(1)
|
||||||
from cgi import escape
|
try:
|
||||||
|
from cgi import escape
|
||||||
|
except:
|
||||||
|
from html import escape
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from time import time
|
from time import time
|
||||||
from werkzeug.contrib.fixers import ProxyFix
|
from werkzeug.contrib.fixers import ProxyFix
|
||||||
|
|
Loading…
Reference in New Issue