def _candidate_tempdir_list():
 dirlist = []
 for envname in ('TMPDIR', 'TEMP', 'TMP'):
  dirname = _os.getenv(envname)
  if dirname:
   dirlist.append(dirname)
 if (_os.name == 'riscos'):
  dirname = _os.getenv('Wimp$ScrapDir')
  if dirname:
   dirlist.append(dirname)
 elif (_os.name == 'nt'):
  dirlist.extend(['c:\\temp', 'c:\\tmp', '\\temp', '\\tmp'])
 else:
  dirlist.extend(['/tmp', '/var/tmp', '/usr/tmp'])
 try:
  dirlist.append(_os.getcwd())
 except (AttributeError, _os.error):
  dirlist.append(_os.curdir)
 return dirlist

def _candidate_tempdir_list ( ) : dirlist = [ ] for envname in ( 'TMPDIR' , 'TEMP' , 'TMP' ) : dirname = _os . getenv ( envname ) if dirname : dirlist . append ( dirname ) if ( _os . name == 'riscos' ) : dirname = _os . getenv ( 'Wimp$ScrapDir' ) if dirname : dirlist . append ( dirname ) elif ( _os . name == 'nt' ) : dirlist . extend ( [ 'c:\\temp' , 'c:\\tmp' , '\\temp' , '\\tmp' ] ) else : dirlist . extend ( [ '/tmp' , '/var/tmp' , '/usr/tmp' ] ) try : dirlist . append ( _os . getcwd ( ) ) except ( AttributeError , _os . error ) : dirlist . append ( _os . curdir ) return dirlist
generate a list of candidate temporary directories which _get_default_tempdir will try .