From 52e615dede8538c36f569d2cf07835427a9a0db6 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Wed, 30 Nov 2016 18:43:03 +0100 Subject: [enh] py3 compatibility --- searx/engines/dictzone.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'searx/engines/dictzone.py') diff --git a/searx/engines/dictzone.py b/searx/engines/dictzone.py index 20a9a8980..7c3478629 100644 --- a/searx/engines/dictzone.py +++ b/searx/engines/dictzone.py @@ -10,20 +10,20 @@ """ import re -from urlparse import urljoin from lxml import html from searx.utils import is_valid_lang +from searx.url_utils import urljoin categories = ['general'] url = u'http://dictzone.com/{from_lang}-{to_lang}-dictionary/{query}' weight = 100 -parser_re = re.compile(u'.*?([a-z]+)-([a-z]+) ([^ ]+)$', re.I) +parser_re = re.compile(b'.*?([a-z]+)-([a-z]+) ([^ ]+)$', re.I) results_xpath = './/table[@id="r"]/tr' def request(query, params): - m = parser_re.match(unicode(query, 'utf8')) + m = parser_re.match(query) if not m: return params -- cgit v1.2.3