[Python-checkins] cpython (3.2): Issue #8746: Use tempfile module to get tempdir and randomize the

ned.deily python-checkins at python.org
Tue Jul 26 23:00:14 CEST 2011


http://hg.python.org/cpython/rev/4e4554aa1453
changeset:   71508:4e4554aa1453
branch:      3.2
parent:      71504:070dc6e359fb
user:        Ned Deily <nad at acm.org>
date:        Tue Jul 26 13:53:55 2011 -0700
summary:
  Issue #8746: Use tempfile module to get tempdir and randomize the
link file name.

files:
  Lib/test/test_posix.py |  4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -12,10 +12,12 @@
 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):
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list