From: Thomas Wouters Date: Mon, 9 Jul 2001 10:45:31 +0000 (+0000) Subject: initregex(): Check return value of PyErr_Warn() and propagate the exception X-Git-Tag: v2.2a3~1302 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4ccf1190535319d37cbc712422fd097cd8f0464f;p=thirdparty%2FPython%2Fcpython.git 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..dc2f19aa6847 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 NULL; /* Initialize regex.error exception */ v = RegexError = PyErr_NewException("regex.error", NULL, NULL);