Mercurial > cpython-lru_cache-weakref
diff Objects/methodobject.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 | 2275612c16a9 |
| children | aef3501d8e77 |
line wrap: on
line diff
--- a/Objects/methodobject.c Tue Mar 25 07:56:27 2008 +0000 +++ b/Objects/methodobject.c Tue Mar 25 08:29:14 2008 +0000 @@ -235,9 +235,10 @@ !PyCFunction_Check(other)) { /* Py3K warning if types are not equal and comparison isn't == or != */ - if (Py_Py3kWarningFlag && PyErr_Warn(PyExc_DeprecationWarning, - "builtin_function_or_method " - "inequality comparisons not supported in 3.x.") < 0) { + if (Py_Py3kWarningFlag && + PyErr_Warn(PyExc_DeprecationWarning, + "builtin_function_or_method inequality " + "comparisons not supported in 3.x") < 0) { return NULL; } @@ -353,12 +354,10 @@ { if (name[0] == '_' && name[1] == '_') { if (strcmp(name, "__methods__") == 0) { - if (Py_Py3kWarningFlag) { - if (PyErr_Warn(PyExc_DeprecationWarning, - "__methods__ not supported " - "in 3.x") < 0) - return NULL; - } + if (Py_Py3kWarningFlag && + PyErr_Warn(PyExc_DeprecationWarning, + "__methods__ not supported in 3.x") < 0) + return NULL; return listmethodchain(chain); } if (strcmp(name, "__doc__") == 0) {
