summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-05-23 06:58:36 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2007-05-23 06:58:36 (GMT)
commitdf25efeae931409fa45ed034337bd81396d19ce0 (patch)
tree3ee0884b1ca93f90c075469147ac0c49edfb244d /Python
parentc792629c83af5a2de409dd0284901131963cc264 (diff)
downloadcpython-df25efeae931409fa45ed034337bd81396d19ce0.zip
cpython-df25efeae931409fa45ed034337bd81396d19ce0.tar.gz
cpython-df25efeae931409fa45ed034337bd81396d19ce0.tar.bz2
Add a bunch more deprecation warnings for builtins that are going away in 3.0
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index cf47c30..ef3eac8 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -191,6 +191,10 @@ Deprecated since release 2.3. Instead, use the extended call syntax:\n\
static PyObject *
builtin_callable(PyObject *self, PyObject *v)
{
+ if (Py_Py3kWarningFlag &&
+ PyErr_Warn(PyExc_DeprecationWarning,
+ "callable() not supported in 3.x") < 0)
+ return NULL;
return PyBool_FromLong((long)PyCallable_Check(v));
}
@@ -389,6 +393,11 @@ builtin_coerce(PyObject *self, PyObject *args)
PyObject *v, *w;
PyObject *res;
+ if (Py_Py3kWarningFlag &&
+ PyErr_Warn(PyExc_DeprecationWarning,
+ "coerce() not supported in 3.x") < 0)
+ return NULL;
+
if (!PyArg_UnpackTuple(args, "coerce", 2, 2, &v, &w))
return NULL;
if (PyNumber_Coerce(&v, &w) < 0)
@@ -631,6 +640,11 @@ builtin_execfile(PyObject *self, PyObject *args)
PyCompilerFlags cf;
int exists;
+ if (Py_Py3kWarningFlag &&
+ PyErr_Warn(PyExc_DeprecationWarning,
+ "execfile() not supported in 3.x") < 0)
+ return NULL;
+
if (!PyArg_ParseTuple(args, "s|O!O:execfile",
&filename,
&PyDict_Type, &globals,
@@ -1800,6 +1814,11 @@ builtin_reduce(PyObject *self, PyObject *args)
{
PyObject *seq, *func, *result = NULL, *it;
+ if (Py_Py3kWarningFlag &&
+ PyErr_Warn(PyExc_DeprecationWarning,
+ "reduce() not supported in 3.x") < 0)
+ return NULL;
+
if (!PyArg_UnpackTuple(args, "reduce", 2, 3, &func, &seq, &result))
return NULL;
if (result != NULL)
@@ -1872,6 +1891,11 @@ sequence is empty.");
static PyObject *
builtin_reload(PyObject *self, PyObject *v)
{
+ if (Py_Py3kWarningFlag &&
+ PyErr_Warn(PyExc_DeprecationWarning,
+ "reload() not supported in 3.x") < 0)
+ return NULL;
+
return PyImport_ReloadModule(v);
}