mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
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:
parent
80055f6295
commit
d5b635f196
16 changed files with 67 additions and 54 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue