From 353a4503129b8cdcb9c32b50424bfeb07dd11cd1 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 27 Feb 2009 03:54:57 +0000 Subject: [PATCH] Open the temp file in text mode for py3k compatibility. svn path=/main/trunk/; revision=12724 --- pym/portage/tests/sets/files/testConfigFileSet.py | 8 +++++--- 1 file 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) -- 2.26.2