3,
'Floating point exception')
- @unittest.skipIf(not hasattr(faulthandler, '_sigbus'),
- "need faulthandler._sigbus()")
+ @unittest.skipIf(_testcapi is None, 'need _testcapi')
+ @unittest.skipUnless(hasattr(signal, 'SIGBUS'), 'need signal.SIGBUS')
def test_sigbus(self):
self.check_fatal_error("""
- import _testcapi
- import faulthandler
- import signal
++ import _testcapi
+ import faulthandler
++ import signal
+
- faulthandler.enable()
- _testcapi.raise_signal(signal.SIGBUS)
- """.strip(),
+ faulthandler.enable()
- faulthandler._sigbus()
++ _testcapi.raise_signal(signal.SIGBUS)
+ """,
- 3,
+ 6,
'Bus error')
- @unittest.skipIf(not hasattr(faulthandler, '_sigill'),
- "need faulthandler._sigill()")
+ @unittest.skipIf(_testcapi is None, 'need _testcapi')
+ @unittest.skipUnless(hasattr(signal, 'SIGILL'), 'need signal.SIGILL')
def test_sigill(self):
self.check_fatal_error("""
- import _testcapi
- import faulthandler
- import signal
++ import _testcapi
+ import faulthandler
++ import signal
+
- faulthandler.enable()
- _testcapi.raise_signal(signal.SIGILL)
- """.strip(),
+ faulthandler.enable()
- faulthandler._sigill()
++ _testcapi.raise_signal(signal.SIGILL)
+ """,
- 3,
+ 6,
'Illegal instruction')
def test_fatal_error(self):