Fix logic error in Python/_warnings.c and add a test to verify

This commit is contained in:
Benjamin Peterson 2008-05-06 22:18:11 +00:00
parent c730d5f7e5
commit d295032910
2 changed files with 11 additions and 0 deletions

View file

@ -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);