diff -r c33596e6f723 Python/_warnings.c --- a/Python/_warnings.c Sat Apr 16 23:14:40 2011 +0300 +++ b/Python/_warnings.c Sun Apr 17 12:37:45 2011 +0200 @@ -409,10 +409,10 @@ else { PyObject *res; - if (!PyMethod_Check(show_fxn) && !PyFunction_Check(show_fxn)) { + if (!PyCallable_Check(show_fxn)) { PyErr_SetString(PyExc_TypeError, "warnings.showwarning() must be set to a " - "function or method"); + "callable"); Py_DECREF(show_fxn); goto cleanup; }