]> granicus.if.org Git - python/commitdiff
test_faulthandler: use _sigsegv() instead of _read_null()
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 17 Jun 2013 21:37:59 +0000 (23:37 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 17 Jun 2013 21:37:59 +0000 (23:37 +0200)
faulthandler._read_null() is not reliable: it does not crash on AIX.

Lib/test/test_faulthandler.py

index c171faf2302b27ddb3f6c8ca09bc72955a6ffb1d..5afc7cca229539e58c307a2fe5d7fb3d32bd4eac 100644 (file)
@@ -206,20 +206,20 @@ faulthandler._read_null(True)
 import faulthandler
 output = open({filename}, 'wb')
 faulthandler.enable(output)
-faulthandler._read_null()
+faulthandler._sigsegv()
 """.strip().format(filename=repr(filename)),
                 4,
-                '(?:Segmentation fault|Bus error|Illegal instruction)',
+                'Segmentation fault',
                 filename=filename)
 
     def test_enable_single_thread(self):
         self.check_fatal_error("""
 import faulthandler
 faulthandler.enable(all_threads=False)
-faulthandler._read_null()
+faulthandler._sigsegv()
 """.strip(),
             3,
-            '(?:Segmentation fault|Bus error|Illegal instruction)',
+            'Segmentation fault',
             all_threads=False)
 
     def test_disable(self):
@@ -227,7 +227,7 @@ faulthandler._read_null()
 import faulthandler
 faulthandler.enable()
 faulthandler.disable()
-faulthandler._read_null()
+faulthandler._sigsegv()
 """.strip()
         not_expected = 'Fatal Python error'
         with support.suppress_crash_popup():