From 0af83c053c90a3b82c63050769b278bb6b69681c Mon Sep 17 00:00:00 2001 From: Anthony Baxter Date: Thu, 1 Nov 2001 14:55:03 +0000 Subject: [PATCH] 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.) --- Modules/regexmodule.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); -- 2.47.3