summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/tests/sets/files/testConfigFileSet.py3
-rw-r--r--pym/portage/tests/sets/files/testStaticFileSet.py5
2 files changed, 4 insertions, 4 deletions
diff --git a/pym/portage/tests/sets/files/testConfigFileSet.py b/pym/portage/tests/sets/files/testConfigFileSet.py
index a7a9645cd..7ea17fd1b 100644
--- a/pym/portage/tests/sets/files/testConfigFileSet.py
+++ b/pym/portage/tests/sets/files/testConfigFileSet.py
@@ -13,8 +13,7 @@ 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')
+ f = os.fdopen(fd, 'w')
for i in range(0, len(test_cps)):
atom = test_cps[i]
if i % 2 == 0:
diff --git a/pym/portage/tests/sets/files/testStaticFileSet.py b/pym/portage/tests/sets/files/testStaticFileSet.py
index 4c7a191b1..fff583da1 100644
--- a/pym/portage/tests/sets/files/testStaticFileSet.py
+++ b/pym/portage/tests/sets/files/testStaticFileSet.py
@@ -15,8 +15,9 @@ class StaticFileSetTestCase(TestCase):
def setUp(self):
fd, self.testfile = tempfile.mkstemp(suffix=".testdata", prefix=self.__class__.__name__, text=True)
- os.close(fd)
- open(self.testfile, 'w').write("\n".join(test_cps))
+ f = os.fdopen(fd, 'w')
+ f.write("\n".join(test_cps))
+ f.close()
def tearDown(self):
os.unlink(self.testfile)