*** Python-2.3.2/Modules/_sre.c Thu Jun 26 07:41:08 2003 --- Python-2.3/Modules/_sre.c Thu Nov 20 22:03:14 2003 *************** *** 122,127 **** --- 122,128 ---- #define SRE_ERROR_STATE -2 /* illegal state */ #define SRE_ERROR_RECURSION_LIMIT -3 /* runaway recursion */ #define SRE_ERROR_MEMORY -9 /* out of memory */ + #define SRE_ERROR_INTERRUPTED -10 /* signal handler raised exception */ #if defined(VERBOSE) #define TRACE(v) printf v *************** *** 743,748 **** --- 744,751 ---- /* check if string matches the given pattern. returns <0 for error, 0 for failure, and 1 for success */ + if (PyErr_CheckSignals()) return SRE_ERROR_INTERRUPTED; + SRE_CHAR* end = state->end; SRE_CHAR* ptr = state->ptr; int i, count; *************** *** 1690,1695 **** --- 1693,1701 ---- case SRE_ERROR_MEMORY: PyErr_NoMemory(); break; + case SRE_ERROR_INTERRUPTED: + /* An exception has already been raised, so let it fly */ + break; default: /* other error codes indicate compiler/engine bugs */ PyErr_SetString(