]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
initregex(): Check return value of PyErr_Warn() and propagate the exception
authorThomas Wouters <thomas@python.org>
Mon, 9 Jul 2001 10:45:31 +0000 (10:45 +0000)
committerThomas Wouters <thomas@python.org>
Mon, 9 Jul 2001 10:45:31 +0000 (10:45 +0000)
(if any.)

Modules/regexmodule.c

index 8509f483f5434c8b05d5a07aa018b14f4879b513..dc2f19aa68476e90f70662593294d1bea3291509 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 NULL;
        
        /* Initialize regex.error exception */
        v = RegexError = PyErr_NewException("regex.error", NULL, NULL);