mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Fix SF bug #690435, apply fails to check if warning raises exception
(patch provided by Greg Chapman)
This commit is contained in:
parent
7aba3d471f
commit
3e59076b1d
1 changed files with 4 additions and 3 deletions
|
@ -75,9 +75,10 @@ builtin_apply(PyObject *self, PyObject *args)
|
||||||
PyObject *func, *alist = NULL, *kwdict = NULL;
|
PyObject *func, *alist = NULL, *kwdict = NULL;
|
||||||
PyObject *t = NULL, *retval = NULL;
|
PyObject *t = NULL, *retval = NULL;
|
||||||
|
|
||||||
PyErr_Warn(PyExc_PendingDeprecationWarning,
|
if (PyErr_Warn(PyExc_PendingDeprecationWarning,
|
||||||
"use func(*args, **kwargs) instead of "
|
"use func(*args, **kwargs) instead of "
|
||||||
"apply(func, args, kwargs)");
|
"apply(func, args, kwargs)") < 0)
|
||||||
|
return NULL;
|
||||||
if (!PyArg_UnpackTuple(args, "apply", 1, 3, &func, &alist, &kwdict))
|
if (!PyArg_UnpackTuple(args, "apply", 1, 3, &func, &alist, &kwdict))
|
||||||
return NULL;
|
return NULL;
|
||||||
if (alist != NULL) {
|
if (alist != NULL) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue