def custom_popen(cmd):
 creationflags = 0
 if (sys.platform == 'win32'):
  creationflags = 134217728
 try:
  p = Popen(cmd, bufsize=0, stdout=PIPE, stdin=PIPE, stderr=STDOUT, creationflags=creationflags)
 except OSError:
  ex = sys.exc_info()[1]
  if (ex.errno == errno.ENOENT):
   raise RarCannotExec(('Unrar not installed? (rarfile.UNRAR_TOOL=%r)' % UNRAR_TOOL))
  raise
 return p

def custom_popen ( cmd ) : creationflags = 0 if ( sys . platform == 'win32' ) : creationflags = 134217728 try : p = Popen ( cmd , bufsize = 0 , stdout = PIPE , stdin = PIPE , stderr = STDOUT , creationflags = creationflags ) except OSError : ex = sys . exc_info ( ) [ 1 ] if ( ex . errno == errno . ENOENT ) : raise RarCannotExec ( ( 'Unrar not installed? (rarfile.UNRAR_TOOL=%r)' % UNRAR_TOOL ) ) raise return p
disconnect cmd from parent fds .