summaryrefslogtreecommitdiff
path: root/bs4/dammit.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2012-08-17 09:26:28 -0400
committerLeonard Richardson <leonardr@segfault.org>2012-08-17 09:26:28 -0400
commitcff5b21e13c8952f693a327eecdcf6c3c6cd5050 (patch)
tree3c2e0cf721e47b101d0852903044d2562eb012ef /bs4/dammit.py
parentc9c66ed8e08fd2ff5073e2a5b16dfe3304b3848a (diff)
Fixed cchardet import.
Diffstat (limited to 'bs4/dammit.py')
-rw-r--r--bs4/dammit.py6
1 files 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):