From 8b2bfbc198c1fe0dcdfd42cc4683879cd712ccfd Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Wed, 23 May 2007 06:35:32 +0000 Subject: Add -3 option to the interpreter to warn about features that are deprecated and will be changed/removed in Python 3.0. This patch is mostly from Anthony. I tweaked some format and added a little doc. --- Python/bltinmodule.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Python') diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index a846377ec6..cf47c30889 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -144,6 +144,11 @@ builtin_apply(PyObject *self, PyObject *args) PyObject *func, *alist = NULL, *kwdict = NULL; PyObject *t = NULL, *retval = NULL; + if (Py_Py3kWarningFlag && + PyErr_Warn(PyExc_DeprecationWarning, + "apply() not supported in 3.x") < 0) + return NULL; + if (!PyArg_UnpackTuple(args, "apply", 1, 3, &func, &alist, &kwdict)) return NULL; if (alist != NULL) { -- cgit v1.2.1