summaryrefslogtreecommitdiff
path: root/Lib/tempfile.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-01-15 03:26:36 +0000
committerTim Peters <tim.peters@gmail.com>2001-01-15 03:26:36 +0000
commitb90f89a496676ec714e111a747344600f3988496 (patch)
tree161c61762992b5c1588c9a49f557ad88b31b091f /Lib/tempfile.py
parent495ad3c8ccb9ed3554177a3e8687676c78e667de (diff)
downloadcpython-git-b90f89a496676ec714e111a747344600f3988496.tar.gz
Whitespace normalization.
Diffstat (limited to 'Lib/tempfile.py')
-rw-r--r--Lib/tempfile.py50
1 files changed, 25 insertions, 25 deletions
diff --git a/Lib/tempfile.py b/Lib/tempfile.py
index 8ac707d7e0..a503e7fe57 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -26,10 +26,10 @@ def gettempdir():
elif os.name == 'mac':
import macfs, MACFS
try:
- refnum, dirid = macfs.FindFolder(MACFS.kOnSystemDisk,
- MACFS.kTemporaryFolderType, 1)
- dirname = macfs.FSSpec((refnum, dirid, '')).as_pathname()
- attempdirs.insert(0, dirname)
+ refnum, dirid = macfs.FindFolder(MACFS.kOnSystemDisk,
+ MACFS.kTemporaryFolderType, 1)
+ dirname = macfs.FSSpec((refnum, dirid, '')).as_pathname()
+ attempdirs.insert(0, dirname)
except macfs.error:
pass
for envname in 'TMPDIR', 'TEMP', 'TMP':
@@ -38,27 +38,27 @@ def gettempdir():
testfile = gettempprefix() + 'test'
for dir in attempdirs:
try:
- filename = os.path.join(dir, testfile)
- if os.name == 'posix':
- try:
- fd = os.open(filename, os.O_RDWR|os.O_CREAT|os.O_EXCL, 0700)
- except OSError:
- pass
- else:
- fp = os.fdopen(fd, 'w')
- fp.write('blat')
- fp.close()
- os.unlink(filename)
- del fp, fd
- tempdir = dir
- break
- else:
- fp = open(filename, 'w')
- fp.write('blat')
- fp.close()
- os.unlink(filename)
- tempdir = dir
- break
+ filename = os.path.join(dir, testfile)
+ if os.name == 'posix':
+ try:
+ fd = os.open(filename, os.O_RDWR|os.O_CREAT|os.O_EXCL, 0700)
+ except OSError:
+ pass
+ else:
+ fp = os.fdopen(fd, 'w')
+ fp.write('blat')
+ fp.close()
+ os.unlink(filename)
+ del fp, fd
+ tempdir = dir
+ break
+ else:
+ fp = open(filename, 'w')
+ fp.write('blat')
+ fp.close()
+ os.unlink(filename)
+ tempdir = dir
+ break
except IOError:
pass
if tempdir is None: