Index: Modules/_testcapimodule.c =================================================================== --- Modules/_testcapimodule.c (revision 84639) +++ Modules/_testcapimodule.c (working copy) @@ -11,6 +11,9 @@ #include #include "structmember.h" #include "datetime.h" +#if defined(_MSC_VER) && _MSC_VER < 1400 +#include +#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 Index: Python/pythonrun.c =================================================================== --- Python/pythonrun.c (revision 84639) +++ Python/pythonrun.c (working copy) @@ -2086,7 +2086,7 @@ PyErr_PrintEx(0); } #ifdef MS_WINDOWS - { + if (IsDebuggerPresent()) { size_t len = strlen(msg); WCHAR* buffer; size_t i; @@ -2100,10 +2100,10 @@ OutputDebugStringW(L"Fatal Python error: "); OutputDebugStringW(buffer); OutputDebugStringW(L"\n"); - } #ifdef _DEBUG - DebugBreak(); + DebugBreak(); #endif + } #endif /* MS_WINDOWS */ abort(); }