diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-07-12 03:49:13 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-07-12 03:49:13 -0700 |
commit | f9197545f7686d610d6d153fb2dbbb4d4d65bb7e (patch) | |
tree | 0c0dc0fff6650528444011d602298c13d257b80b | |
parent | 1fb22f0f5a7c529593703cc794730245afc41a1a (diff) | |
download | portage-f9197545f7686d610d6d153fb2dbbb4d4d65bb7e.tar.gz portage-f9197545f7686d610d6d153fb2dbbb4d4d65bb7e.tar.bz2 portage-f9197545f7686d610d6d153fb2dbbb4d4d65bb7e.zip |
Fix writemsg to only use fd.buffer when it is stderr or stdout.
-rw-r--r-- | pym/portage/util/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py index 3c552025b..821428d12 100644 --- a/pym/portage/util/__init__.py +++ b/pym/portage/util/__init__.py @@ -58,7 +58,7 @@ def writemsg(mystr,noiselevel=0,fd=None): # avoid potential UnicodeEncodeError mystr = _unicode_encode(mystr, encoding=_encodings['stdio'], errors='backslashreplace') - if sys.hexversion >= 0x3000000: + if sys.hexversion >= 0x3000000 and fd in (sys.stdout, sys.stderr): fd = fd.buffer fd.write(mystr) fd.flush() |