chrome/updater/test/service/win/rpc_handler.py
def RunAsSystem(self, command, env=None, cwd=None, timeout=30):
    """Runs the command as SYSTEM user.

    Args:
      command: The command to run. This argument will be forwarded to
        subprocess.Popen().
      env: Environment variables to pass to command.
      cwd: Working directory for the command.
      timeout: How long the child process should wait before timeout.

    Returns:
      (pid, exit_code, sdtout, stderr) tuple.
    """
    try:
      process = subprocess.Popen(
          command, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
          env=env, cwd=cwd)

      # TODO(crbug.com/1233612): `communicate()` in Python 2.7 does not support
      # timeout value, pass the value here once we migrate to Python 3. Also
      # don't forget to handle subprocess.TimeoutExpired exception.
      stdout, stderr = process.communicate()
      logging.info('Command %s stdout:\n %s', command, stdout)
      if stderr:
        logging.error('Command %s stderr:\n %s', command, stderr)

      return (process.pid, process.returncode, stdout, stderr)
    except OSError as err:
      logging.exception(err)
      return (None, None, None, None)
Runs the command as SYSTEM user.

    Args:
      command: The command to run. This argument will be forwarded to
        subprocess.Popen().
      env: Environment variables to pass to command.
      cwd: Working directory for the command.
      timeout: How long the child process should wait before timeout.

    Returns:
      (pid, exit_code, sdtout, stderr) tuple.
    
Runs the command as SYSTEM user.
Runs the command as SYSTEM user .
def RunAsSystem(self, command, env=None, cwd=None, timeout=30):
    try:
      process = subprocess.Popen(
          command, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
          env=env, cwd=cwd)
      stdout, stderr = process.communicate()
      logging.info('Command %s stdout:\n %s', command, stdout)
      if stderr:
        logging.error('Command %s stderr:\n %s', command, stderr)
      return (process.pid, process.returncode, stdout, stderr)
    except OSError as err:
      logging.exception(err)
      return (None, None, None, None)
def RunAsSystem ( self , command , env = None , cwd = None , timeout = 30 ) : try : process = subprocess . Popen ( command , stdout = subprocess . PIPE , stderr = subprocess . PIPE , env = env , cwd = cwd ) stdout , stderr = process . communicate ( ) logging . info ( 'Command %s stdout:\n %s' , command , stdout ) if stderr : logging . error ( 'Command %s stderr:\n %s' , command , stderr ) return ( process . pid , process . returncode , stdout , stderr ) except OSError as err : logging . exception ( err ) return ( None , None , None , None )
Runs the command as SYSTEM user.
Runs the command as SYSTEM user .
"""Runs the command as SYSTEM user.

    Args:
      command: The command to run. This argument will be forwarded to
        subprocess.Popen().
      env: Environment variables to pass to command.
      cwd: Working directory for the command.
      timeout: How long the child process should wait before timeout.

    Returns:
      (pid, exit_code, sdtout, stderr) tuple.
    """ # TODO(crbug.com/1233612): `communicate()` in Python 2.7 does not support # timeout value, pass the value here once we migrate to Python 3. Also # don't forget to handle subprocess.TimeoutExpired exception.
(pid, exit_code, sdtout, stderr) tuple.
( pid exit_code sdtout stderr ) tuple .
self
command
The command to run. This argument will be forwarded to
subprocess.Popen().
The command to run . This argument will be forwarded to subprocess . Popen () .
env
Environment variables to pass to command.
Environment variables to pass to command .
cwd
Working directory for the command.
Working directory for the command .
timeout
None