mirror of
https://github.com/python/cpython.git
synced 2025-10-12 18:02:39 +00:00
(Merge 3.3) test_faulthandler: use _sigsegv() instead of _read_null()
faulthandler._read_null() is not reliable: it does not crash on AIX.
This commit is contained in:
commit
e08d4881f8
1 changed files with 5 additions and 5 deletions
|
@ -206,20 +206,20 @@ faulthandler._read_null(True)
|
||||||
import faulthandler
|
import faulthandler
|
||||||
output = open({filename}, 'wb')
|
output = open({filename}, 'wb')
|
||||||
faulthandler.enable(output)
|
faulthandler.enable(output)
|
||||||
faulthandler._read_null()
|
faulthandler._sigsegv()
|
||||||
""".strip().format(filename=repr(filename)),
|
""".strip().format(filename=repr(filename)),
|
||||||
4,
|
4,
|
||||||
'(?:Segmentation fault|Bus error|Illegal instruction)',
|
'Segmentation fault',
|
||||||
filename=filename)
|
filename=filename)
|
||||||
|
|
||||||
def test_enable_single_thread(self):
|
def test_enable_single_thread(self):
|
||||||
self.check_fatal_error("""
|
self.check_fatal_error("""
|
||||||
import faulthandler
|
import faulthandler
|
||||||
faulthandler.enable(all_threads=False)
|
faulthandler.enable(all_threads=False)
|
||||||
faulthandler._read_null()
|
faulthandler._sigsegv()
|
||||||
""".strip(),
|
""".strip(),
|
||||||
3,
|
3,
|
||||||
'(?:Segmentation fault|Bus error|Illegal instruction)',
|
'Segmentation fault',
|
||||||
all_threads=False)
|
all_threads=False)
|
||||||
|
|
||||||
def test_disable(self):
|
def test_disable(self):
|
||||||
|
@ -227,7 +227,7 @@ faulthandler._read_null()
|
||||||
import faulthandler
|
import faulthandler
|
||||||
faulthandler.enable()
|
faulthandler.enable()
|
||||||
faulthandler.disable()
|
faulthandler.disable()
|
||||||
faulthandler._read_null()
|
faulthandler._sigsegv()
|
||||||
""".strip()
|
""".strip()
|
||||||
not_expected = 'Fatal Python error'
|
not_expected = 'Fatal Python error'
|
||||||
with support.suppress_crash_popup():
|
with support.suppress_crash_popup():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue