mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-35568: add 'raise_signal' function (GH-11335)
As in title, expose C `raise` function as `raise_function` in `signal` module. Also drop existing `raise_signal` in `_testcapi` module and replace all usages with new function. https://bugs.python.org/issue35568
This commit is contained in:
parent
e61cc481e0
commit
c24c6c2c93
10 changed files with 122 additions and 47 deletions
|
@ -198,14 +198,13 @@ class FaultHandlerTests(unittest.TestCase):
|
|||
@skip_segfault_on_android
|
||||
def test_sigbus(self):
|
||||
self.check_fatal_error("""
|
||||
import _testcapi
|
||||
import faulthandler
|
||||
import signal
|
||||
|
||||
faulthandler.enable()
|
||||
_testcapi.raise_signal(signal.SIGBUS)
|
||||
signal.raise_signal(signal.SIGBUS)
|
||||
""",
|
||||
6,
|
||||
5,
|
||||
'Bus error')
|
||||
|
||||
@unittest.skipIf(_testcapi is None, 'need _testcapi')
|
||||
|
@ -213,14 +212,13 @@ class FaultHandlerTests(unittest.TestCase):
|
|||
@skip_segfault_on_android
|
||||
def test_sigill(self):
|
||||
self.check_fatal_error("""
|
||||
import _testcapi
|
||||
import faulthandler
|
||||
import signal
|
||||
|
||||
faulthandler.enable()
|
||||
_testcapi.raise_signal(signal.SIGILL)
|
||||
signal.raise_signal(signal.SIGILL)
|
||||
""",
|
||||
6,
|
||||
5,
|
||||
'Illegal instruction')
|
||||
|
||||
def test_fatal_error(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue