summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2001-07-09 10:45:31 (GMT)
committerThomas Wouters <thomas@python.org>2001-07-09 10:45:31 (GMT)
commit4ccf1190535319d37cbc712422fd097cd8f0464f (patch)
treefa13ae01c178f35d5da8ae431c4f75cf29ea2afa /Modules
parent4e566ab904ef4712cb116bccc7a47bd4f0b8d764 (diff)
downloadcpython-4ccf1190535319d37cbc712422fd097cd8f0464f.zip
cpython-4ccf1190535319d37cbc712422fd097cd8f0464f.tar.gz
cpython-4ccf1190535319d37cbc712422fd097cd8f0464f.tar.bz2
initregex(): Check return value of PyErr_Warn() and propagate the exception
(if any.)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/regexmodule.c6
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);