utils/web.py: Properly import chardet.

This commit is contained in:
Valentin Lorentz 2013-06-12 17:38:50 +00:00
parent 8095f34250
commit a82ad9cb1a

View File

@ -190,7 +190,7 @@ def htmlToText(s, tagReplace=' '):
"""Turns HTML into text. tagReplace is a string to replace HTML tags with. """Turns HTML into text. tagReplace is a string to replace HTML tags with.
""" """
try: try:
import chardet import chardet.universaldetector
except ImportError: except ImportError:
s = s.decode('utf8') s = s.decode('utf8')
else: else: