@interruptable
def start_command(cmd, cwd=None, add_env=None, universal_newlines=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, no_win32_startupinfo=False, stderr=subprocess.PIPE, **extra):
 env = extra.pop(u'env', None)
 if (add_env is not None):
  env = os.environ.copy()
  env.update(add_env)
 shell = extra.get(u'shell', False)
 cmd = prep_for_subprocess(cmd, shell=shell)
 if (WIN32 and (cwd == getcwd())):
  cwd = None
 if (PY2 and cwd):
  cwd = encode(cwd)
 if WIN32:
  startupinfo = subprocess.STARTUPINFO()
  startupinfo.dwFlags = subprocess.STARTF_USESHOWWINDOW
  startupinfo.wShowWindow = subprocess.SW_HIDE
  extra[u'startupinfo'] = startupinfo
  if (WIN32 and (not no_win32_startupinfo)):
   CREATE_NO_WINDOW = 134217728
   extra[u'creationflags'] = CREATE_NO_WINDOW
 return subprocess.Popen(cmd, bufsize=1, stdin=stdin, stdout=stdout, stderr=stderr, cwd=cwd, env=env, universal_newlines=universal_newlines, **extra)

@ interruptable def start_command ( cmd , cwd = None , add_env = None , universal_newlines = False , stdin = subprocess . PIPE , stdout = subprocess . PIPE , no_win32_startupinfo = False , stderr = subprocess . PIPE , ** extra ) : env = extra . pop ( u'env' , None ) if ( add_env is not None ) : env = os . environ . copy ( ) env . update ( add_env ) shell = extra . get ( u'shell' , False ) cmd = prep_for_subprocess ( cmd , shell = shell ) if ( WIN32 and ( cwd == getcwd ( ) ) ) : cwd = None if ( PY2 and cwd ) : cwd = encode ( cwd ) if WIN32 : startupinfo = subprocess . STARTUPINFO ( ) startupinfo . dwFlags = subprocess . STARTF_USESHOWWINDOW startupinfo . wShowWindow = subprocess . SW_HIDE extra [ u'startupinfo' ] = startupinfo if ( WIN32 and ( not no_win32_startupinfo ) ) : CREATE_NO_WINDOW = 134217728 extra [ u'creationflags' ] = CREATE_NO_WINDOW return subprocess . Popen ( cmd , bufsize = 1 , stdin = stdin , stdout = stdout , stderr = stderr , cwd = cwd , env = env , universal_newlines = universal_newlines , ** extra )
start the given command .