summaryrefslogtreecommitdiffstats
path: root/Python/_warnings.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-05-06 22:18:11 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-05-06 22:18:11 (GMT)
commitd29503291013b7dfd70522e776b0c244aff0a264 (patch)
tree4bcf1eea33328c03196b89d82fdaa47b8761dc99 /Python/_warnings.c
parentc730d5f7e5a6f83b7ac71bc2393d2c848b95f30b (diff)
downloadcpython-d29503291013b7dfd70522e776b0c244aff0a264.zip
cpython-d29503291013b7dfd70522e776b0c244aff0a264.tar.gz
cpython-d29503291013b7dfd70522e776b0c244aff0a264.tar.bz2
Fix logic error in Python/_warnings.c and add a test to verify
Diffstat (limited to 'Python/_warnings.c')
-rw-r--r--Python/_warnings.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 0e48675..e75d4fd 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -400,6 +400,8 @@ warn_explicit(PyObject *category, PyObject *message,
PyErr_SetString(PyExc_TypeError,
"warnings.showwarning() must be set to a "
"function or method");
+ Py_DECREF(show_fxn);
+ goto cleanup;
}
defaults = PyFunction_GetDefaults(check_fxn);