diff options
author | Guido van Rossum <guido@python.org> | 1996-08-20 20:38:59 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-08-20 20:38:59 (GMT) |
commit | 3e065ada2c878b20e3386b48f7e5a1e23925f3d2 (patch) | |
tree | 765be2e6e7bddac0c08aba9657f72590f6b960eb | |
parent | 34f173110fbe9f765c43f38b5a5731b5539eb295 (diff) | |
download | cpython-3e065ada2c878b20e3386b48f7e5a1e23925f3d2.zip cpython-3e065ada2c878b20e3386b48f7e5a1e23925f3d2.tar.gz cpython-3e065ada2c878b20e3386b48f7e5a1e23925f3d2.tar.bz2 |
Attempt at Windows-NT compatibility.
-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) |