def RunProcess()

in annotated_steps.py [0:0]


def RunProcess(command, shell=False, extra_env=None):
  """
  Runs command.

  If a non-zero exit code is returned, raises an OSError with errno as the exit
  code.
  """
  env = dict(os.environ)
  env['TERM'] = 'nocolor'
  if 'GIT_USER_AGENT' in env:
    del env['GIT_USER_AGENT']
  if extra_env:
    env.update(extra_env)
  print "Running: %s" % ' '.join(command)
  print "env: %s" % str(env)
  sys.stdout.flush()
  exit_code = subprocess.call(command, env=env, shell=shell)
  if exit_code != 0:
    raise OSError(exit_code)