()
return dirlist
Generate a list of candidate temporary directories which
    _get_default_tempdir will try.
Generate a list of candidate temporary directories which
    _get_default_tempdir will try.
Generate a list of candidate temporary directories which _get_default_tempdir will try .
def _candidate_tempdir_list():
    """Generate a list of candidate temporary directories which
    _get_default_tempdir will try."""

    dirlist = []

    # First, try the environment.
    for envname in 'TMPDIR', 'TEMP', 'TMP':
        dirname = _os.getenv(envname)
        if dirname: dirlist.append(dirname)

    # Failing that, try OS-specific locations.
    if _os.name == 'nt':
        dirlist.extend([ _os.path.expanduser(r'~\AppData\Local\Temp'),
                         _os.path.expandvars(r'%SYSTEMROOT%\Temp'),
                         r'c:\temp', r'c:\tmp', r'\temp', r'\tmp' ])
    else:
        dirlist.extend([ '/tmp', '/var/tmp', '/usr/tmp' ])

    # As a last resort, the current directory.
    try:
        dirlist.append(_os.getcwd())
    except (AttributeError, OSError):
        dirlist.append(_os.curdir)

    return dirlist
def _candidate_tempdir_list ( ) : dirlist = [ ] # First, try the environment. for envname in 'TMPDIR' , 'TEMP' , 'TMP' : dirname = _os . getenv ( envname ) if dirname : dirlist . append ( dirname ) # Failing that, try OS-specific locations. if _os . name == 'nt' : dirlist . extend ( [ _os . path . expanduser ( r'~\AppData\Local\Temp' ) , _os . path . expandvars ( r'%SYSTEMROOT%\Temp' ) , r'c:\temp' , r'c:\tmp' , r'\temp' , r'\tmp' ] ) else : dirlist . extend ( [ '/tmp' , '/var/tmp' , '/usr/tmp' ] ) # As a last resort, the current directory. try : dirlist . append ( _os . getcwd ( ) ) except ( AttributeError , OSError ) : dirlist . append ( _os . curdir ) return dirlist