def enable_sig_handler(signal_name, handler):
 if hasattr(signal, signal_name):
  signal.signal(getattr(signal, signal_name), handler)

def enable_sig_handler ( signal_name , handler ) : if hasattr ( signal , signal_name ) : signal . signal ( getattr ( signal , signal_name ) , handler )
add signal handler for signal name if it exists on given platform .