Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b45b315

Browse files
committed
Patch #1350409: Port signal handling to VS 2005.
1 parent 3a9a3e7 commit b45b315

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ David Chaum
113113
Nicolas Chauvat
114114
Michael Chermside
115115
Albert Chin-A-Young
116+
Adal Chiriliuc
116117
Tom Christiansen
117118
Vadim Chugunov
118119
David Cinege

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ What's New in Python 2.5 alpha 1?
1212
Core and builtins
1313
-----------------
1414

15+
- Patch #1350409: Work around signal handling bug in Visual Studio 2005.
16+
1517
- Bug #1281408: Py_BuildValue now works correct even with unsigned longs
1618
and long longs.
1719

Python/pythonrun.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,6 +1615,23 @@ PyOS_getsig(int sig)
16151615
return context.sa_handler;
16161616
#else
16171617
PyOS_sighandler_t handler;
1618+
/* Special signal handling for the secure CRT in Visual Studio 2005 */
1619+
#if defined(_MSC_VER) && _MSC_VER >= 1400
1620+
switch (sig) {
1621+
/* Only these signals are valid */
1622+
case SIGINT:
1623+
case SIGILL:
1624+
case SIGFPE:
1625+
case SIGSEGV:
1626+
case SIGTERM:
1627+
case SIGBREAK:
1628+
case SIGABRT:
1629+
break;
1630+
/* Don't call signal() with other values or it will assert */
1631+
default:
1632+
return SIG_ERR;
1633+
}
1634+
#endif /* _MSC_VER && _MSC_VER >= 1400 */
16181635
handler = signal(sig, SIG_IGN);
16191636
if (handler != SIG_ERR)
16201637
signal(sig, handler);

0 commit comments

Comments
 (0)