summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-02-27 03:54:57 +0000
committerZac Medico <zmedico@gentoo.org>2009-02-27 03:54:57 +0000
commit353a4503129b8cdcb9c32b50424bfeb07dd11cd1 (patch)
tree0e6810193fc2ef84e65be80df2c27254dc41b744
parent223c15a9ceb5aca07ed52142250fa851c381fb21 (diff)
downloadportage-353a4503129b8cdcb9c32b50424bfeb07dd11cd1.tar.gz
portage-353a4503129b8cdcb9c32b50424bfeb07dd11cd1.tar.bz2
portage-353a4503129b8cdcb9c32b50424bfeb07dd11cd1.zip
Open the temp file in text mode for py3k compatibility.
svn path=/main/trunk/; revision=12724
-rw-r--r--pym/portage/tests/sets/files/testConfigFileSet.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pym/portage/tests/sets/files/testConfigFileSet.py b/pym/portage/tests/sets/files/testConfigFileSet.py
index 5a54e6a78..a7a9645cd 100644
--- a/pym/portage/tests/sets/files/testConfigFileSet.py
+++ b/pym/portage/tests/sets/files/testConfigFileSet.py
@@ -13,13 +13,15 @@ class ConfigFileSetTestCase(TestCase):
def setUp(self):
fd, self.testfile = tempfile.mkstemp(suffix=".testdata", prefix=self.__class__.__name__, text=True)
+ os.close(fd)
+ f = open(self.testfile, 'w')
for i in range(0, len(test_cps)):
atom = test_cps[i]
if i % 2 == 0:
- os.write(fd, atom+" abc def"+"\n")
+ f.write(atom + ' abc def\n')
else:
- os.write(fd, atom+"\n")
- os.close(fd)
+ f.write(atom + '\n')
+ f.close()
def tearDown(self):
os.unlink(self.testfile)