Mercurial > cpython-lru_cache-weakref
diff Python/bltinmodule.c @ 41832:a0ee3b2ba361 legacy-trunk
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.
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Wed, 23 May 2007 06:35:32 +0000 |
| parents | 78686c7a23a7 |
| children | 9a447514855f |
line wrap: on
line diff
--- a/Python/bltinmodule.c Wed May 23 02:04:28 2007 +0000 +++ b/Python/bltinmodule.c Wed May 23 06:35:32 2007 +0000 @@ -144,6 +144,11 @@ 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) {
