parameters: (signalnum, additional_handler)
docstring: Adds a signal handler for the given signal in the wrapped context.
  
    This runs the new handler after any existing handler rather than
    replacing the existing handler.
  
    Args:
      signum: The signal for which a handler should be added.
      additional_handler: The handler to add.
docstring_summary: Adds a signal handler for the given signal in the wrapped context.
docstring_tokens: Adds a signal handler for the given signal in the wrapped context .
function: def AddSignalHandler(signalnum, additional_handler):
    """Adds a signal handler for the given signal in the wrapped context.
  
    This runs the new handler after any existing handler rather than
    replacing the existing handler.
  
    Args:
      signum: The signal for which a handler should be added.
      additional_handler: The handler to add.
    """
    existing_handler = signal.getsignal(signalnum)
  
    def handler(signum, frame):
      if callable(existing_handler):
        existing_handler(signum, frame)
      additional_handler(signum, frame)
  
    try:
      signal.signal(signalnum, handler)
      yield
    finally:
      signal.signal(signalnum, existing_handler)
function_tokens: def AddSignalHandler ( signalnum , additional_handler ) : existing_handler = signal . getsignal ( signalnum ) def handler ( signum , frame ) : if callable ( existing_handler ) : existing_handler ( signum , frame ) additional_handler ( signum , frame ) try : signal . signal ( signalnum , handler ) yield finally : signal . signal ( signalnum , existing_handler )