]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Attempt at Windows-NT compatibility.
authorGuido van Rossum <guido@python.org>
Tue, 20 Aug 1996 20:38:59 +0000 (20:38 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 20 Aug 1996 20:38:59 +0000 (20:38 +0000)
Lib/tempfile.py

index c1413898b52013a73cb8aa4b0f2711be0b402e37..615b8033db68cf86b18b3e37b8f349905fdcfd97 100644 (file)
@@ -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)