old_contents: from __future__ import with_statement
  
  
  import os
  import signal
  
  from nose.tools import assert_equal, assert_raises
  
  from pyfits.tests import PyfitsTestCase
  from pyfits.tests.util import catch_warnings
  from pyfits.util import ignore_sigint
  
  
  class TestUtils(PyfitsTestCase):
      def test_ignore_sigint(self):
  
          @ignore_sigint
          def test():
              with catch_warnings(record=True) as w:
                  pid = os.getpid()
                  os.kill(pid, signal.SIGINT)
                  # One more time, for good measure
                  os.kill(pid, signal.SIGINT)
                  assert_equal(len(w), 2)
                  assert_equal(str(w[0].message),
                               'KeyboardInterrupt ignored until test is '
                               'complete!')
  
          assert_raises(KeyboardInterrupt, test)
  
new_contents: from __future__ import with_statement
  
  
  import os
  import signal
  
  import nose
  from nose.tools import assert_equal, assert_raises
  
  from pyfits.tests import PyfitsTestCase
  from pyfits.tests.util import catch_warnings
  from pyfits.util import ignore_sigint
  
  
  class TestUtils(PyfitsTestCase):
      def test_ignore_sigint(self):
          if not hasattr(os, 'kill'):
              # Not available in some Python versions on Windows
              raise nose.SkipTest('os.kill() not available')
  
          @ignore_sigint
          def test():
              with catch_warnings(record=True) as w:
                  pid = os.getpid()
                  os.kill(pid, signal.SIGINT)
                  # One more time, for good measure
                  os.kill(pid, signal.SIGINT)
                  assert_equal(len(w), 2)
                  assert_equal(str(w[0].message),
                               'KeyboardInterrupt ignored until test is '
                               'complete!')
  
          assert_raises(KeyboardInterrupt, test)
  
subject: Disable this test whenever os.kill isn't available. I tried to find a clever way to do this with ctypes but it just wasn't working reliably.