Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r12722 - main/trunk/pym/portage/sets
Date: Fri, 27 Feb 2009 03:24:16
Message-Id: E1LctKg-0000UR-98@stork.gentoo.org
1 Author: zmedico
2 Date: 2009-02-27 03:24:13 +0000 (Fri, 27 Feb 2009)
3 New Revision: 12722
4
5 Modified:
6 main/trunk/pym/portage/sets/shell.py
7 Log:
8 Use unicode() so that 2to3 handles py3k compatibility.
9
10
11 Modified: main/trunk/pym/portage/sets/shell.py
12 ===================================================================
13 --- main/trunk/pym/portage/sets/shell.py 2009-02-27 03:08:03 UTC (rev 12721)
14 +++ main/trunk/pym/portage/sets/shell.py 2009-02-27 03:24:13 UTC (rev 12722)
15 @@ -4,7 +4,6 @@
16
17 import subprocess
18 import os
19 -import sys
20
21 from portage.sets.base import PackageSet
22 from portage.sets import SetConfigError
23 @@ -35,10 +34,7 @@
24 def load(self):
25 pipe = subprocess.Popen(self._command, stdout=subprocess.PIPE, shell=True)
26 if pipe.wait() == os.EX_OK:
27 - text = pipe.stdout.read()
28 - if sys.hexversion >= 0x3000000:
29 - encoding = sys.getdefaultencoding()
30 - text = text.decode(encoding, 'replace')
31 + text = unicode(pipe.stdout.read(), errors='replace')
32 self._setAtoms(text.splitlines())
33
34 def singleBuilder(self, options, settings, trees):