summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-03-25 08:29:14 (GMT)
committerGeorg Brandl <georg@python.org>2008-03-25 08:29:14 (GMT)
commitd5b635f1969fdd609f0aff5669c9ec30e61be62e (patch)
tree1c854f8108e2b22d8c5ba4d529b6d99cd9f5f244 /Python/bltinmodule.c
parent80055f6295dd48274ae68d13806c7ee3c5b5882f (diff)
downloadcpython-d5b635f1969fdd609f0aff5669c9ec30e61be62e.zip
cpython-d5b635f1969fdd609f0aff5669c9ec30e61be62e.tar.gz
cpython-d5b635f1969fdd609f0aff5669c9ec30e61be62e.tar.bz2
Make Py3k warnings consistent w.r.t. punctuation; also respect the
EOL 80 limit and supply more alternatives in warning messages.
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 3956bb5..c760dcb 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -166,7 +166,8 @@ builtin_apply(PyObject *self, PyObject *args)
if (Py_Py3kWarningFlag &&
PyErr_Warn(PyExc_DeprecationWarning,
- "apply() not supported in 3.x. Use func(*args, **kwargs).") < 0)
+ "apply() not supported in 3.x; "
+ "use func(*args, **kwargs)") < 0)
return NULL;
if (!PyArg_UnpackTuple(args, "apply", 1, 3, &func, &alist, &kwdict))
@@ -225,7 +226,8 @@ builtin_callable(PyObject *self, PyObject *v)
{
if (Py_Py3kWarningFlag &&
PyErr_Warn(PyExc_DeprecationWarning,
- "callable() not supported in 3.x. Use hasattr(o, '__call__').") < 0)
+ "callable() not supported in 3.x; "
+ "use hasattr(o, '__call__')") < 0)
return NULL;
return PyBool_FromLong((long)PyCallable_Check(v));
}
@@ -684,7 +686,7 @@ builtin_execfile(PyObject *self, PyObject *args)
if (Py_Py3kWarningFlag &&
PyErr_Warn(PyExc_DeprecationWarning,
- "execfile() not supported in 3.x. Use exec().") < 0)
+ "execfile() not supported in 3.x; use exec()") < 0)
return NULL;
if (!PyArg_ParseTuple(args, "s|O!O:execfile",
@@ -912,7 +914,8 @@ builtin_map(PyObject *self, PyObject *args)
if (func == Py_None) {
if (Py_Py3kWarningFlag &&
PyErr_Warn(PyExc_DeprecationWarning,
- "map(None, ...) not supported in 3.x. Use list(...).") < 0)
+ "map(None, ...) not supported in 3.x; "
+ "use list(...)") < 0)
return NULL;
if (n == 1) {
/* map(None, S) is the same as list(S). */
@@ -1934,7 +1937,8 @@ builtin_reduce(PyObject *self, PyObject *args)
if (Py_Py3kWarningFlag &&
PyErr_Warn(PyExc_DeprecationWarning,
- "reduce() not supported in 3.x") < 0)
+ "reduce() not supported in 3.x; "
+ "use functools.reduce()") < 0)
return NULL;
if (!PyArg_UnpackTuple(args, "reduce", 2, 3, &func, &seq, &result))
@@ -2011,7 +2015,7 @@ builtin_reload(PyObject *self, PyObject *v)
{
if (Py_Py3kWarningFlag &&
PyErr_Warn(PyExc_DeprecationWarning,
- "reload() not supported in 3.x") < 0)
+ "reload() not supported in 3.x; use imp.reload()") < 0)
return NULL;
return PyImport_ReloadModule(v);