]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Use $TMPDIR if it is set in the environment.
authorGuido van Rossum <guido@python.org>
Tue, 14 Jan 1992 18:31:56 +0000 (18:31 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 14 Jan 1992 18:31:56 +0000 (18:31 +0000)
Lib/tempfile.py

index a571f413ffa62c4270d7777934d9d4dcf9eb7cfa..793c23f5d2485598f9ce72de5c0d3444240ee85f 100644 (file)
@@ -5,11 +5,16 @@ import path
 
 
 # Changeable parameters (by clients!)...
-# XXX Should the environment variable $TMPDIR override tempdir?
 
 tempdir = '/usr/tmp'
 template = '@'
 
+# Use environment variable $TMPDIR to override default tempdir.
+
+if posix.environ.has_key('TMPDIR'):
+       # XXX Could check that it's a writable directory...
+       tempdir = posix.environ['TMPDIR']
+
 
 # Counter for generating unique names