Don't try to call setdefaultencoding() since it's not intended to be called.
authorZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 06:14:33 +0000 (06:14 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 06:14:33 +0000 (06:14 -0000)
(trunk r12692)

svn path=/main/branches/2.1.6/; revision=12950

pym/portage/__init__.py

index 4dfce23d18f58e86bba78b2b8c4803a474eb4430..077e25540054fedeb7271770c310f43bc80fde81 100644 (file)
@@ -7563,16 +7563,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