Mercurial > cpython-lru_cache-weakref
diff Python/bltinmodule.c @ 46075:84bb7701efba legacy-trunk
Make Py3k warnings consistent w.r.t. punctuation; also respect the
EOL 80 limit and supply more alternatives in warning messages.
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Tue, 25 Mar 2008 08:29:14 +0000 |
| parents | e665a0b16da0 |
| children | 5341b30b1812 |
line wrap: on
line diff
--- a/Python/bltinmodule.c Tue Mar 25 07:56:27 2008 +0000 +++ b/Python/bltinmodule.c Tue Mar 25 08:29:14 2008 +0000 @@ -166,7 +166,8 @@ 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 @@ { 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 @@ 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 @@ 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 @@ 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 @@ { 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);
