aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-07-16 14:16:27 +0200
committerMichał Górny <mgorny@gentoo.org>2020-07-16 20:04:43 +0200
commit8aaf817db51f0369095b0f7d93cdbecdfc32c869 (patch)
tree93aba669b4382810b7f6a00de506ccce69f283e9 /lib/portage/output.py
parentBinTestCase: export PORTAGE_PYTHON (diff)
downloadportage-8aaf817db51f0369095b0f7d93cdbecdfc32c869.tar.gz
portage-8aaf817db51f0369095b0f7d93cdbecdfc32c869.tar.bz2
portage-8aaf817db51f0369095b0f7d93cdbecdfc32c869.zip
Eliminate the most of explicit py3 conditionals
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 <zmedico@gentoo.org> Closes: https://github.com/gentoo/portage/pull/574 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'lib/portage/output.py')
-rw-r--r--lib/portage/output.py4
1 files changed, 1 insertions, 3 deletions
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()