(original) (raw)
diff -ur py3k+issue8863/Lib/test/test_fault.py working/Lib/test/test_fault.py --- py3k+issue8863/Lib/test/test_fault.py 2010-12-23 22:54:23.859375000 +0000 +++ working/Lib/test/test_fault.py 2010-12-23 22:54:39.328125000 +0000 @@ -38,7 +38,7 @@ b'Segmentation fault') @unittest.skipIf(sys.platform == 'win32', - "SIGFPE cannot be catched on Windows") + "SIGFPE cannot be caught on Windows") def test_sigfpe(self): self.check_output( ("import _testcapi; _testcapi.sigfpe()",), diff -ur py3k+issue8863/Modules/_testcapimodule.c working/Modules/_testcapimodule.c --- py3k+issue8863/Modules/_testcapimodule.c 2010-12-23 22:27:21.500000000 +0000 +++ working/Modules/_testcapimodule.c 2010-12-23 22:28:25.609375000 +0000 @@ -2282,24 +2282,22 @@ return PyLong_FromLong(x / y); } -#if defined(SIGBUS) && defined(HAVE_KILL) +#ifdef SIGBUS static PyObject * sigbus(PyObject *self, PyObject *args) { - pid_t pid = getpid(); while(1) - kill(pid, SIGBUS); + raise(SIGBUS); Py_RETURN_NONE; } #endif -#if defined(SIGILL) && defined(HAVE_KILL) +#ifdef SIGILL static PyObject * sigill(PyObject *self, PyObject *args) { - pid_t pid = getpid(); while(1) - kill(pid, SIGILL); + raise(SIGILL); Py_RETURN_NONE; } #endif @@ -2398,10 +2396,10 @@ {"format_unicode", format_unicode, METH_VARARGS}, {"sigsegv", sigsegv, METH_VARARGS}, {"sigfpe", sigfpe, METH_NOARGS}, -#if defined(SIGBUS) && defined(HAVE_KILL) +#ifdef SIGBUS {"sigbus", sigbus, METH_NOARGS}, #endif -#if defined(SIGILL) && defined(HAVE_KILL) +#ifdef SIGILL {"sigill", sigill, METH_NOARGS}, #endif {"fatal_error", fatal_error, METH_VARARGS}, diff -ur py3k+issue8863/Python/fault.c working/Python/fault.c --- py3k+issue8863/Python/fault.c 2010-12-23 22:51:41.515625000 +0000 +++ working/Python/fault.c 2010-12-23 22:52:36.015625000 +0000 @@ -9,7 +9,9 @@ #include "frameobject.h" #include "code.h" #include +#ifdef HAVE_UNISTD_H #include +#endif #define MAX_DEPTH 100