Open the temp file in text mode for py3k compatibility.
authorZac Medico <zmedico@gentoo.org>
Fri, 27 Feb 2009 03:54:57 +0000 (03:54 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 27 Feb 2009 03:54:57 +0000 (03:54 -0000)
svn path=/main/trunk/; revision=12724

pym/portage/tests/sets/files/testConfigFileSet.py

index 5a54e6a7866793f65c3d56bb93bbe112e23eb6b0..a7a9645cd505cf73ccf71778ce394f5a7174355c 100644 (file)
@@ -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)