diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 62aa5121f5b..e2465916ee4 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -75,9 +75,10 @@ builtin_apply(PyObject *self, PyObject *args) PyObject *func, *alist = NULL, *kwdict = NULL; PyObject *t = NULL, *retval = NULL; - PyErr_Warn(PyExc_PendingDeprecationWarning, - "use func(*args, **kwargs) instead of " - "apply(func, args, kwargs)"); + if (PyErr_Warn(PyExc_PendingDeprecationWarning, + "use func(*args, **kwargs) instead of " + "apply(func, args, kwargs)") < 0) + return NULL; if (!PyArg_UnpackTuple(args, "apply", 1, 3, &func, &alist, &kwdict)) return NULL; if (alist != NULL) {