diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-03-11 06:14:33 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-03-11 06:14:33 +0000 |
commit | 9bfbcf22862b56c5c3200892f6397b0a9780bd56 (patch) | |
tree | 0e61b90756c9628247e7b47a0ded050c3602251e | |
parent | 4f5fe68e80abc8f7409ee8568211184901c1c302 (diff) | |
download | portage-9bfbcf22862b56c5c3200892f6397b0a9780bd56.tar.gz portage-9bfbcf22862b56c5c3200892f6397b0a9780bd56.tar.bz2 portage-9bfbcf22862b56c5c3200892f6397b0a9780bd56.zip |
Don't try to call setdefaultencoding() since it's not intended to be called.
(trunk r12692)
svn path=/main/branches/2.1.6/; revision=12950
-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 4dfce23d1..077e25540 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -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 |