initregex(): this function is declared void, so the recent change to
return NULL in an error case was itself an error.
initregex(): Check return value of PyErr_Warn() and propagate the exception
(if any.)
m = Py_InitModule("regex", regex_global_methods);
d = PyModule_GetDict(m);
- PyErr_Warn(PyExc_DeprecationWarning,
- "the regex module is deprecated; please use the re module");
+ if (PyErr_Warn(PyExc_DeprecationWarning,
+ "the regex module is deprecated; "
+ "please use the re module") < 0)
+ return;
/* Initialize regex.error exception */
v = RegexError = PyErr_NewException("regex.error", NULL, NULL);