From 3e065ada2c878b20e3386b48f7e5a1e23925f3d2 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 20 Aug 1996 20:38:59 +0000 Subject: [PATCH] Attempt at Windows-NT compatibility. --- Lib/tempfile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/tempfile.py b/Lib/tempfile.py index c1413898b52..615b8033db6 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -21,9 +21,12 @@ def gettempdir(): if tempdir is not None: return tempdir attempdirs = ['/usr/tmp', '/tmp', os.getcwd(), os.curdir] + if os.name == 'nt': + attempdirs.insert(0, 'C:\\TEMP') + attempdirs.insert(0, '\\TEMP') if os.environ.has_key('TMPDIR'): attempdirs.insert(0, os.environ['TMPDIR']) - testfile = gettempprefix() + '-*-writetest-*-' + testfile = gettempprefix() + 'test' for dir in attempdirs: try: filename = os.path.join(dir, testfile)