diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-02-23 08:32:37 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-02-23 08:32:37 +0000 |
commit | 36383ddf8a608a4df5818071f26884acd1170d8c (patch) | |
tree | 9a4d4bae9ae575563a37db961eba4d1402e02dc2 | |
parent | 22f3323fca7b52db6f4cd7ede3ebfc04a6ec737f (diff) | |
download | portage-36383ddf8a608a4df5818071f26884acd1170d8c.tar.gz portage-36383ddf8a608a4df5818071f26884acd1170d8c.tar.bz2 portage-36383ddf8a608a4df5818071f26884acd1170d8c.zip |
Don't try to call setdefaultencoding() since it's not intended to be called.
svn path=/main/trunk/; revision=12692
-rw-r--r-- | pym/portage/__init__.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index a5323b007..5891732a6 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -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 |