diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/tempfile.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/tempfile.py b/Lib/tempfile.py index c141389..615b803 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) |