Author: andar

Revision: 5315

Log:
        Make chardet a non-optional dependency in 1.2.x

Diff:
Modified: trunk/deluge/ui/common.py
===================================================================
--- trunk/deluge/ui/common.py   2009-05-27 16:31:36 UTC (rev 5314)
+++ trunk/deluge/ui/common.py   2009-05-27 19:18:13 UTC (rev 5315)
@@ -37,6 +37,8 @@
 import sys
 import urlparse
 
+import chardet
+
 try:
     from hashlib import sha1 as sha
 except ImportError:
@@ -60,12 +62,7 @@
     try:
         s = s.decode(encoding).encode("utf8")
     except UnicodeDecodeError:
-        try:
-            import chardet
-        except ImportError:
-            s = s.decode(encoding, "replace").encode("utf8")
-        else:
-            s = s.decode(chardet.detect(s)["encoding"]).encode("utf8")
+        s = s.decode(chardet.detect(s)["encoding"]).encode("utf8")
     return s
 
 class TorrentInfo(object):



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to