Make Py3k warnings consistent w.r.t. punctuation; also respect the

EOL 80 limit and supply more alternatives in warning messages.
This commit is contained in:
Georg Brandl 2008-03-25 08:29:14 +00:00
parent 80055f6295
commit d5b635f196
16 changed files with 67 additions and 54 deletions

View file

@ -235,9 +235,10 @@ meth_richcompare(PyObject *self, PyObject *other, int op)
!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 @@ Py_FindMethodInChain(PyMethodChain *chain, PyObject *self, const char *name)
{
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) {