]> granicus.if.org Git - python/commitdiff
Fix SF bug #690435, apply fails to check if warning raises exception
authorNeal Norwitz <nnorwitz@gmail.com>
Sun, 23 Feb 2003 21:45:43 +0000 (21:45 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sun, 23 Feb 2003 21:45:43 +0000 (21:45 +0000)
(patch provided by Greg Chapman)

Python/bltinmodule.c

index 62aa5121f5bbb04eef6141a07d799ac6006feb07..e2465916ee496b1b524519ede4e6089e8d35e49d 100644 (file)
@@ -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) {