]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
backport of (merged) 1.43 and 1.44
authorAnthony Baxter <anthonybaxter@gmail.com>
Thu, 1 Nov 2001 14:55:03 +0000 (14:55 +0000)
committerAnthony Baxter <anthonybaxter@gmail.com>
Thu, 1 Nov 2001 14:55:03 +0000 (14:55 +0000)
  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

index 8509f483f5434c8b05d5a07aa018b14f4879b513..c0e465aadb72efc5a6f4eaeaab182094d92faf99 100644 (file)
@@ -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);