summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-05-23 06:35:32 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2007-05-23 06:35:32 (GMT)
commit8b2bfbc198c1fe0dcdfd42cc4683879cd712ccfd (patch)
tree9f3e2eed06cc877197eaadc398fb0bd12f5b9db3 /Python/bltinmodule.c
parent5f2ba9f2b1d5bd7ce9a6388dc58624403ca54547 (diff)
downloadcpython-8b2bfbc198c1fe0dcdfd42cc4683879cd712ccfd.zip
cpython-8b2bfbc198c1fe0dcdfd42cc4683879cd712ccfd.tar.gz
cpython-8b2bfbc198c1fe0dcdfd42cc4683879cd712ccfd.tar.bz2
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.
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index a846377..cf47c30 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) {