def _mkstemp_inner(dir, pre, suf, flags):
 names = _get_candidate_names()
 for seq in xrange(TMP_MAX):
  name = names.next()
  file = _os.path.join(dir, ((pre + name) + suf))
  try:
   fd = _os.open(file, flags, 384)
   _set_cloexec(fd)
   return (fd, _os.path.abspath(file))
  except OSError as e:
   if (e.errno == _errno.EEXIST):
    continue
   if ((_os.name == 'nt') and (e.errno == _errno.EACCES)):
    continue
   raise
 raise IOError, (_errno.EEXIST, 'No usable temporary file name found')

def _mkstemp_inner ( dir , pre , suf , flags ) : names = _get_candidate_names ( ) for seq in xrange ( TMP_MAX ) : name = names . next ( ) file = _os . path . join ( dir , ( ( pre + name ) + suf ) ) try : fd = _os . open ( file , flags , 384 ) _set_cloexec ( fd ) return ( fd , _os . path . abspath ( file ) ) except OSError as e : if ( e . errno == _errno . EEXIST ) : continue if ( ( _os . name == 'nt' ) and ( e . errno == _errno . EACCES ) ) : continue raise raise IOError , ( _errno . EEXIST , 'No usable temporary file name found' )
code common to mkstemp .