Don't try to call setdefaultencoding() since it's not intended to be called.
authorZac Medico <zmedico@gentoo.org>
Mon, 23 Feb 2009 08:32:37 +0000 (08:32 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 23 Feb 2009 08:32:37 +0000 (08:32 -0000)
svn path=/main/trunk/; revision=12692

pym/portage/__init__.py

index a5323b007dc49f33d04eab9ce2043c2d2925ac8c..5891732a61b64d05fb2fafd440a1533e51c79f18 100644 (file)
@@ -7576,16 +7576,12 @@ def _ensure_default_encoding():
 
                default_fallback = 'utf_8'
 
-               if hasattr(sys, 'setdefaultencoding'):
-                       sys.setdefaultencoding(default_fallback)
-               else:
-                       # The sys.setdefaultencoding() function doesn't exist,
-                       # so just make the fallback codec correspond to whatever
-                       # name happens to be returned by sys.getdefaultencoding().
-                       try:
-                               encodings[default_encoding] = codecs.lookup(default_fallback)
-                       except LookupError:
-                               encodings[default_encoding] = encodings[default_fallback]
+               # Make the fallback codec correspond to whatever name happens
+               # to be returned by sys.getdefaultencoding().
+               try:
+                       encodings[default_encoding] = codecs.lookup(default_fallback)
+               except LookupError:
+                       encodings[default_encoding] = encodings[default_fallback]
 
                del default_fallback