| Index: Modules/_testcapimodule.c |
| =================================================================== |
| --- Modules/_testcapimodule.c (revision 84639) |
| +++ Modules/_testcapimodule.c (working copy) |
| @@ -11,6 +11,9 @@ |
| #include <float.h> |
| #include "structmember.h" |
| #include "datetime.h" |
| +#if defined(_MSC_VER) && _MSC_VER < 1400 |
| +#include <crtdbg.h> |
| +#endif |
| #ifdef WITH_THREAD |
| #include "pythread.h" |
| @@ -2183,6 +2186,16 @@ |
| static PyObject * |
| crash_no_current_thread(PyObject *self) |
| { |
| +#ifdef _MSC_VER |
| + /* PyThreadState_Get() will halt via abort(). Following function |
| + call is needed to supress popup of the dialog box */ |
| +# if _MSC_VER >= 1400 |
| + _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT); |
| +# else |
| + /* XXX: abort() prints "abnormal program termination" */ |
| + _CrtSetReportMode(_CRT_ERROR, 0); |
| +# endif |
| +#endif |
| Py_BEGIN_ALLOW_THREADS |
| /* Using PyThreadState_Get() directly allows the test to pass in |
| !pydebug mode. However, the test only actually tests anything |