Commit d02d2953 authored by Guido van Rossum's avatar Guido van Rossum

Attempt at Windows-NT compatibility.

parent fdfacbc3
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment