mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
faulthandler: improve_sigabrt() on Visual Studio
Use _set_abort_behavior() + abort() instead of raise(SIGABRT) which may write an error message and/or open a popup asking to report the fault.
This commit is contained in:
parent
660e62cd75
commit
00bc6ccb78
1 changed files with 5 additions and 7 deletions
|
@ -816,14 +816,12 @@ faulthandler_sigfpe(PyObject *self, PyObject *args)
|
||||||
static PyObject *
|
static PyObject *
|
||||||
faulthandler_sigabrt(PyObject *self, PyObject *args)
|
faulthandler_sigabrt(PyObject *self, PyObject *args)
|
||||||
{
|
{
|
||||||
#if _MSC_VER
|
#ifdef _MSC_VER
|
||||||
/* If Python is compiled in debug mode with Visual Studio, abort() opens
|
/* Visual Studio: configure abort() to not display an error message nor
|
||||||
a popup asking the user how to handle the assertion. Use raise(SIGABRT)
|
open a popup asking to report the fault. */
|
||||||
instead. */
|
_set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
|
||||||
raise(SIGABRT);
|
|
||||||
#else
|
|
||||||
abort();
|
|
||||||
#endif
|
#endif
|
||||||
|
abort();
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue