Commit 374e728c authored by Thomas Wouters's avatar Thomas Wouters

initregex(): Check return value of PyErr_Warn() and propagate the exception

(if any.)
parent 34cb141d
......@@ -660,8 +660,10 @@ initregex(void)
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 NULL;
/* Initialize regex.error exception */
v = RegexError = PyErr_NewException("regex.error", NULL, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment