From d29503291013b7dfd70522e776b0c244aff0a264 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Tue, 6 May 2008 22:18:11 +0000 Subject: Fix logic error in Python/_warnings.c and add a test to verify --- Python/_warnings.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Python') diff --git a/Python/_warnings.c b/Python/_warnings.c index 0e48675d81..e75d4fd06a 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); -- cgit v1.2.1