From cff5b21e13c8952f693a327eecdcf6c3c6cd5050 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Fri, 17 Aug 2012 09:26:28 -0400 Subject: Fixed cchardet import. --- bs4/dammit.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bs4/dammit.py b/bs4/dammit.py index b8828cb..983ade0 100644 --- a/bs4/dammit.py +++ b/bs4/dammit.py @@ -19,17 +19,17 @@ try: # PyPI package: cchardet import cchardet def chardet_dammit(s): - return cchardet.detect(s) + return cchardet.detect(s)['encoding'] except ImportError: try: # Fall back to the pure Python implementation # Debian package: python-chardet # PyPI package: chardet import chardet - #import chardet.constants - #chardet.constants._debug = 1 def chardet_dammit(s): return chardet.detect(s)['encoding'] + #import chardet.constants + #chardet.constants._debug = 1 except ImportError: # No chardet available. def chardet_dammit(s): -- cgit v1.2.3