[Python-checkins] r55528 - python/trunk/Python/bltinmodule.c
neal.norwitz
python-checkins at python.org
Wed May 23 08:58:38 CEST 2007
Author: neal.norwitz
Date: Wed May 23 08:58:36 2007
New Revision: 55528
Modified:
python/trunk/Python/bltinmodule.c
Log:
Add a bunch more deprecation warnings for builtins that are going away in 3.0
Modified: python/trunk/Python/bltinmodule.c
==============================================================================
--- python/trunk/Python/bltinmodule.c (original)
+++ python/trunk/Python/bltinmodule.c Wed May 23 08:58:36 2007
@@ -191,6 +191,10 @@
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 @@
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 @@
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 @@
{
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 @@
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);
}
More information about the Python-checkins
mailing list