From: Anthony Baxter Date: Thu, 1 Nov 2001 14:55:03 +0000 (+0000) Subject: backport of (merged) 1.43 and 1.44 X-Git-Tag: v2.1.2c1~83 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0af83c053c90a3b82c63050769b278bb6b69681c;p=thirdparty%2FPython%2Fcpython.git backport of (merged) 1.43 and 1.44 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.) --- diff --git a/Modules/regexmodule.c b/Modules/regexmodule.c index 8509f483f543..c0e465aadb72 100644 --- a/Modules/regexmodule.c +++ b/Modules/regexmodule.c @@ -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; /* Initialize regex.error exception */ v = RegexError = PyErr_NewException("regex.error", NULL, NULL);