mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
merge heads
This commit is contained in:
commit
bd9c655c97
6 changed files with 41 additions and 17 deletions
|
@ -409,10 +409,10 @@ warn_explicit(PyObject *category, PyObject *message,
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue