parameters: (args, root_dir=None)
return_statement: return None
docstring: Runs `gn` with provided args and return error if any.
docstring_summary: Runs `gn` with provided args and return error if any.
docstring_tokens: Runs gn with provided args and return error if any .
function: def RunGnCommand(args, root_dir=None):
    """Runs `gn` with provided args and return error if any."""
    try:
      command = [
        sys.executable,
        os.path.join(find_depot_tools.DEPOT_TOOLS_PATH, 'gn.py')
      ] + args
      subprocess.check_output(command, cwd=root_dir)
    except subprocess.CalledProcessError as err:
      return err.output
    return None
function_tokens: def RunGnCommand ( args , root_dir = None ) : try : command = [ sys . executable , os . path . join ( find_depot_tools . DEPOT_TOOLS_PATH , 'gn.py' ) ] + args subprocess . check_output ( command , cwd = root_dir ) except subprocess . CalledProcessError as err : return err . output return None