From 8aaf817db51f0369095b0f7d93cdbecdfc32c869 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Thu, 16 Jul 2020 14:16:27 +0200 Subject: Eliminate the most of explicit py3 conditionals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Eliminate the most of py2/py3 conditions in the code. Leave a few where the relevant code is unclear, they will be addressed later. Reviewed-by: Zac Medico Closes: https://github.com/gentoo/portage/pull/574 Signed-off-by: Michał Górny --- lib/portage/output.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/portage/output.py') diff --git a/lib/portage/output.py b/lib/portage/output.py index 6fbb24f4c..8bfcd91c2 100644 --- a/lib/portage/output.py +++ b/lib/portage/output.py @@ -256,9 +256,7 @@ def xtermTitle(mystr, raw=False): # avoid potential UnicodeEncodeError mystr = _unicode_encode(mystr, encoding=_encodings['stdio'], errors='backslashreplace') - f = sys.stderr - if sys.hexversion >= 0x3000000: - f = f.buffer + f = sys.stderr.buffer f.write(mystr) f.flush() -- cgit v1.2.3-65-gdbad