def RegisterSignalHandler(signal_num, handler, is_final_handler=False):
  if signal_num not in GetCaughtSignals():
    raise RuntimeError('Attempt to register handler (%s) for signal %d, which '
                       'is not in GetCaughtSignals' % (handler, signal_num))
  if is_final_handler:
    _final_signal_handlers[signal_num] = handler
  else:
    _non_final_signal_handlers[signal_num].append(handler)
Registers a handler for signal signal_num.
dataset/ETHPy150Open GoogleCloudPlatform/gsutil/gslib/sig_handling.py/RegisterSignalHandler