*** pythonrunOriginal.c Wed Nov 2 14:09:57 2005 --- pythonrun.c Mon Nov 7 17:17:13 2005 *************** *** 1654,1659 **** --- 1654,1676 ---- return context.sa_handler; #else PyOS_sighandler_t handler; + /* Special signal handling for the secure CRT in Visual Studio 2005 */ + #if defined(_MSC_VER) && _MSC_VER >= 1400 + switch (sig) { + /* Only these signals are valid */ + case SIGINT: + case SIGILL: + case SIGFPE: + case SIGSEGV: + case SIGTERM: + case SIGBREAK: + case SIGABRT: + break; + /* Don't call signal() with other values or it will assert */ + default: + return SIG_ERR; + } + #endif /* _MSC_VER && _MSC_VER >= 1400 */ handler = signal(sig, SIG_IGN); if (handler != SIG_ERR) signal(sig, handler);