title: How to avoid overriding of signal handlers in Python?
body: <p>My experiment code is like:</p>
  
  <pre><code>import signal
  
  def hi(signum, frame):
      print "hi"
  
  signal.signal(signal.SIGINT, hi)
  signal.signal(signal.SIGINT, signal.SIG_IGN)
  </code></pre>
  
  <p><code>hi</code> didn't get printed, because the signal handler is overridden by <code>signal.SIG_IGN</code>.</p>
  
  <p>How can I avoid this?</p>