Fix unicode error in text search.

This commit is contained in:
Tobias Gruetzmacher 2016-04-10 13:16:30 +02:00
parent e3628ee751
commit f6e605e146

View file

@ -30,8 +30,8 @@ except ImportError:
from . import loader, configuration, languages from . import loader, configuration, languages
from .util import (get_page, makeSequence, get_system_uid, urlopen, getDirname, from .util import (get_page, makeSequence, get_system_uid, urlopen, getDirname,
unescape, tagre, normaliseURL, unescape, tagre, normaliseURL, prettyMatcherList,
prettyMatcherList, requests_session) requests_session)
from .comic import ComicStrip from .comic import ComicStrip
from .output import out from .output import out
from .events import getHandler from .events import getHandler
@ -489,9 +489,9 @@ class _ParserScraper(Scraper):
text = '' text = ''
for match in searchFun(textSearch): for match in searchFun(textSearch):
try: try:
text += ' ' + match.text_content() text += u' ' + match.text_content()
except AttributeError: except AttributeError:
text += ' ' + unicode(match) text += u' ' + match
if text.strip() == '': if text.strip() == '':
if optional: if optional:
return None return None