title: Reset Python SIGINT to default signal handler
body: <p>Version info:</p>
  
  <ul>
  <li>OS: Windows 7 </li>
  <li>Python version 3.3.5</li>
  </ul>
  
  <p>Below is small piece of test code I was playing around. The aim was to ignore <code>CTRL-C</code> being pressed while certain code was being executed, after which the <code>CTRL-C</code> behaviour would be restored.</p>
  
  <pre><code>import signal 
  import time
  
  try:
      # marker 1
      print('No signal handler modifications yet')
      print('Sleeping...')
      time.sleep(10)
  
      # marker 2
      signal.signal(signal.SIGINT, signal.SIG_IGN)
      print('Now ignoring CTRL-C')
      print('Sleeping...')
      time.sleep(10)
  
      # marker 3
      print('Returning control to default signal handler')
      signal.signal(signal.SIGINT, signal.SIG_DFL)
      print('Sleeping...')
      time.sleep(10)
  
  except KeyboardInterrupt:
      print('Ha, you pressed CTRL-C!')
  </code></pre>
  
  <p>What I've observed while playing around with this:</p>
  
  <ul>
  <li><code>CTRL-C</code> sent between <strong>marker 1</strong> and <strong>marker 2</strong> will be processed by the exception handler (as expected).</li>
  <li><code>CTRL-C</code> sent between <strong>marker 2</strong> and <strong>marker 3</strong> is ignored (still, as expected)</li>
  <li><code>CTRL-C</code> sent after <strong>marker 3</strong> is processed but will <strong>not</strong> jump to the exception handler. Instead, Python just <strong>terminates immediately</strong>.</li>
  </ul>
  
  <p>Also, consider this:</p>
  
  <pre><code>&gt;&gt;&gt;import signal
  
  &gt;&gt;&gt;signal.getsignal(signal.SIGINT)
  &lt;built-in function default_int_handler&gt;
  
  &gt;&gt;&gt; signal.getsignal(signal.SIGINT) is signal.SIG_DFL
  False
  
  &gt;&gt;&gt; signal.signal(signal.SIGINT, signal.SIG_DFL)
  &lt;built-in function default_int_handler&gt;
  
  &gt;&gt;&gt; signal.getsignal(signal.SIGINT) is signal.SIG_DFL
  True
  </code></pre>
  
  <p>So initially, while the signal handler is considered the default signal handler, it seems to be a different handler than the one defined by <code>SIG_DFL</code>.</p>
  
  <p>If anyone could shed some light on this, especially while the exception handler is ignored after restoring the signal handler to SIG_DFL.</p>