diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-01-15 03:26:36 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-01-15 03:26:36 (GMT) |
commit | b90f89a496676ec714e111a747344600f3988496 (patch) | |
tree | 161c61762992b5c1588c9a49f557ad88b31b091f /Lib/tempfile.py | |
parent | 495ad3c8ccb9ed3554177a3e8687676c78e667de (diff) | |
download | cpython-b90f89a496676ec714e111a747344600f3988496.zip cpython-b90f89a496676ec714e111a747344600f3988496.tar.gz cpython-b90f89a496676ec714e111a747344600f3988496.tar.bz2 |
Whitespace normalization.
Diffstat (limited to 'Lib/tempfile.py')
-rw-r--r-- | Lib/tempfile.py | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/Lib/tempfile.py b/Lib/tempfile.py index 8ac707d..a503e7f 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: |