parameters: (process, task, cmd_args)
docstring: Wait for task process to complete and update status.
docstring_summary: Wait for task process to complete and update status.
docstring_tokens: Wait for task process to complete and update status .
function: def wait_and_update_task(process, task, cmd_args):
    """Wait for task process to complete and update status."""
    if not process:
      return
    (cmd_stdout, cmd_stderr) = process.communicate()
    code = process.returncode
    if code == 0:
      task.success = True
    task.command = get_process_command(cmd_args)
    task.output = get_process_output(cmd_stdout, cmd_stderr)
    if (not task.success) and ('error' not in task.output.lower()):
      # Failure without error lines likely indicates the process crashed.
      task.output += '\nERROR: Exit code %s (0x%s).' % (code, util.uhex32(code))
      if (code & 0xffffffff) == 0xc0000005:  # Windows-specific error code.
        task.output += ' [Access Violation]'
  
    # Echo command and output.
    task_log = task.command
    task_log += util.colorize_process_output(task.format_output(None, None))
    print(task_log)
function_tokens: def wait_and_update_task ( process , task , cmd_args ) : if not process : return ( cmd_stdout , cmd_stderr ) = process . communicate ( ) code = process . returncode if code == 0 : task . success = True task . command = get_process_command ( cmd_args ) task . output = get_process_output ( cmd_stdout , cmd_stderr ) if ( not task . success ) and ( 'error' not in task . output . lower ( ) ) : # Failure without error lines likely indicates the process crashed. task . output += '\nERROR: Exit code %s (0x%s).' % ( code , util . uhex32 ( code ) ) if ( code & 0xffffffff ) == 0xc0000005 : # Windows-specific error code. task . output += ' [Access Violation]' # Echo command and output. task_log = task . command task_log += util . colorize_process_output ( task . format_output ( None , None ) ) print ( task_log )