parameters: (dir, command)
docstring: Runs the action.
docstring_summary: Runs the action.
docstring_tokens: Runs the action .
function: def RunAction(dir, command):
    """Runs the action."""
    if command[0] == 'python':
      # If the hook specified "python" as the first item, the action is a
      # Python script.  Run it by starting a new copy of the same
      # interpreter.
      command[0] = sys.executable
  
    try:
      gclient_utils.CheckCallAndFilterAndHeader(
          command, cwd=dir, always=True)
    except gclient_utils.Error, e:
      # Use a discrete exit status code of 2 to indicate that a hook action
      # failed.  Users of this script may wish to treat hook action failures
      # differently from VC failures.
      print >> sys.stderr, 'Error: %s' % str(e)
      sys.exit(2)
function_tokens: def RunAction ( dir , command ) : if command [ 0 ] == 'python' : # If the hook specified "python" as the first item, the action is a # Python script.  Run it by starting a new copy of the same # interpreter. command [ 0 ] = sys . executable try : gclient_utils . CheckCallAndFilterAndHeader ( command , cwd = dir , always = True ) except gclient_utils . Error , e : # Use a discrete exit status code of 2 to indicate that a hook action # failed.  Users of this script may wish to treat hook action failures # differently from VC failures. print >> sys . stderr , 'Error: %s' % str ( e ) sys . exit ( 2 )