From: Zac Medico Date: Fri, 27 Feb 2009 03:24:13 +0000 (-0000) Subject: Use unicode() so that 2to3 handles py3k compatibility. X-Git-Tag: v2.2_rc24~93 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=58554a0816c282a35e55bf9a9cc821d026e5aacd;p=portage.git Use unicode() so that 2to3 handles py3k compatibility. svn path=/main/trunk/; revision=12722 --- 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):