diff options
-rw-r--r-- | Modules/regexmodule.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/regexmodule.c b/Modules/regexmodule.c index 8509f48..dc2f19a 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); |