parameters: ()
return_statement: return dirlist
docstring: Generate a list of candidate temporary directories which
      _get_default_tempdir will try.
docstring_summary: Generate a list of candidate temporary directories which
      _get_default_tempdir will try.
docstring_tokens: Generate a list of candidate temporary directories which _get_default_tempdir will try .
function: 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 == 'riscos':
          dirname = _os.getenv('Wimp$ScrapDir')
          if dirname: dirlist.append(dirname)
      elif _os.name == 'nt':
          dirlist.extend([ 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, _os.error):
          dirlist.append(_os.curdir)
  
      return dirlist
function_tokens: 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 == 'riscos' : dirname = _os . getenv ( 'Wimp$ScrapDir' ) if dirname : dirlist . append ( dirname ) elif _os . name == 'nt' : dirlist . extend ( [ 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 , _os . error ) : dirlist . append ( _os . curdir ) return dirlist