summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-03-17 03:47:08 +0000
committerZac Medico <zmedico@gentoo.org>2007-03-17 03:47:08 +0000
commit3d223adeadf30f57233fe3d5657a36a8d1fb432d (patch)
tree14a8db67831234b97e0e56eb90dea268a787efb0
parent88af672495ab60038a275475b0dee8e1b8711494 (diff)
downloadportage-3d223adeadf30f57233fe3d5657a36a8d1fb432d.tar.gz
portage-3d223adeadf30f57233fe3d5657a36a8d1fb432d.tar.bz2
portage-3d223adeadf30f57233fe3d5657a36a8d1fb432d.zip
Use mkstemp to create a random tempfile.
svn path=/main/trunk/; revision=6226
-rw-r--r--pym/portage/tests/env/config/test_PackageMaskFile.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pym/portage/tests/env/config/test_PackageMaskFile.py b/pym/portage/tests/env/config/test_PackageMaskFile.py
index 5cf750d19..83c9095fd 100644
--- a/pym/portage/tests/env/config/test_PackageMaskFile.py
+++ b/pym/portage/tests/env/config/test_PackageMaskFile.py
@@ -3,12 +3,13 @@
# Distributed under the terms of the GNU General Public License v2
# $Id: test_PackageMaskFile.py 6182 2007-03-06 07:35:22Z antarus $
+import os
+
from portage.env.config import PackageMaskFile
from portage.tests import TestCase
class PackageMaskFileTestCase(TestCase):
- fname = 'package.mask'
atoms = ['sys-apps/portage','dev-util/diffball','not@va1id@t0m']
def testPackageMaskLoad(self):
@@ -21,10 +22,11 @@ class PackageMaskFileTestCase(TestCase):
self.NukeFile()
def BuildFile(self):
- f = open(self.fname, 'wb')
+ from tempfile import mkstemp
+ fd, self.fname = mkstemp()
+ f = os.fdopen(fd, 'w')
f.write("\n".join(self.atoms))
f.close()
def NukeFile(self):
- import os
os.unlink(self.fname)