]> granicus.if.org Git - python/commitdiff
Issue #8746: Use tempfile module to get tempdir and randomize the
authorNed Deily <nad@acm.org>
Tue, 26 Jul 2011 20:53:55 +0000 (13:53 -0700)
committerNed Deily <nad@acm.org>
Tue, 26 Jul 2011 20:53:55 +0000 (13:53 -0700)
link file name.

Lib/test/test_posix.py

index 556305003b3d4db87ca5074ab019bae5697c5a2f..09f04ec348412f630237fd194f261ac4df0a796a 100644 (file)
@@ -12,10 +12,12 @@ import os
 import pwd
 import shutil
 import stat
+import tempfile
 import unittest
 import warnings
 
-_DUMMY_SYMLINK = '%s/dummy-symlink' % os.getenv('TMPDIR', '/tmp')
+_DUMMY_SYMLINK = os.path.join(tempfile.gettempdir(),
+                              support.TESTFN + '-dummy-symlink')
 
 class PosixTester(unittest.TestCase):