From 58554a0816c282a35e55bf9a9cc821d026e5aacd Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 27 Feb 2009 03:24:13 +0000 Subject: [PATCH] Use unicode() so that 2to3 handles py3k compatibility. svn path=/main/trunk/; revision=12722 --- pym/portage/sets/shell.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pym/portage/sets/shell.py b/pym/portage/sets/shell.py index 75912c0be..8114b5133 100644 --- a/pym/portage/sets/shell.py +++ b/pym/portage/sets/shell.py @@ -4,7 +4,6 @@ import subprocess import os -import sys from portage.sets.base import PackageSet from portage.sets import SetConfigError @@ -35,10 +34,7 @@ class CommandOutputSet(PackageSet): def load(self): pipe = subprocess.Popen(self._command, stdout=subprocess.PIPE, shell=True) if pipe.wait() == os.EX_OK: - text = pipe.stdout.read() - if sys.hexversion >= 0x3000000: - encoding = sys.getdefaultencoding() - text = text.decode(encoding, 'replace') + text = unicode(pipe.stdout.read(), errors='replace') self._setAtoms(text.splitlines()) def singleBuilder(self, options, settings, trees): -- 2.26.2