mirror of
https://github.com/python/cpython.git
synced 2025-07-27 13:14:41 +00:00
A little reformating of Py3k warnings
This commit is contained in:
parent
fe4948bcef
commit
f19a7b90bd
11 changed files with 33 additions and 35 deletions
|
@ -3157,16 +3157,16 @@ do_raise(PyObject *type, PyObject *value, PyObject *tb)
|
|||
/* Not something you can raise. You get an exception
|
||||
anyway, just not what you specified :-) */
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"exceptions must be classes or instances, not %s",
|
||||
type->ob_type->tp_name);
|
||||
"exceptions must be classes or instances, not %s",
|
||||
type->ob_type->tp_name);
|
||||
goto raise_error;
|
||||
}
|
||||
|
||||
assert(PyExceptionClass_Check(type));
|
||||
if (Py_Py3kWarningFlag && PyClass_Check(type)) {
|
||||
if (PyErr_WarnEx(PyExc_DeprecationWarning,
|
||||
"exceptions must derive from BaseException "
|
||||
"in 3.x", 1) == -1)
|
||||
"exceptions must derive from BaseException "
|
||||
"in 3.x", 1) < 0)
|
||||
goto raise_error;
|
||||
}
|
||||
|
||||
|
@ -4092,7 +4092,7 @@ cmp_outcome(int op, register PyObject *v, register PyObject *w)
|
|||
PyExc_DeprecationWarning,
|
||||
"catching of string "
|
||||
"exceptions is deprecated", 1);
|
||||
if (ret_val == -1)
|
||||
if (ret_val < 0)
|
||||
return NULL;
|
||||
}
|
||||
else if (Py_Py3kWarningFlag &&
|
||||
|
@ -4103,7 +4103,7 @@ cmp_outcome(int op, register PyObject *v, register PyObject *w)
|
|||
ret_val = PyErr_WarnEx(
|
||||
PyExc_DeprecationWarning,
|
||||
CANNOT_CATCH_MSG, 1);
|
||||
if (ret_val == -1)
|
||||
if (ret_val < 0)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -4115,7 +4115,7 @@ cmp_outcome(int op, register PyObject *v, register PyObject *w)
|
|||
PyExc_DeprecationWarning,
|
||||
"catching of string "
|
||||
"exceptions is deprecated", 1);
|
||||
if (ret_val == -1)
|
||||
if (ret_val < 0)
|
||||
return NULL;
|
||||
}
|
||||
else if (Py_Py3kWarningFlag &&
|
||||
|
@ -4126,7 +4126,7 @@ cmp_outcome(int op, register PyObject *v, register PyObject *w)
|
|||
ret_val = PyErr_WarnEx(
|
||||
PyExc_DeprecationWarning,
|
||||
CANNOT_CATCH_MSG, 1);
|
||||
if (ret_val == -1)
|
||||
if (ret_val < 0)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue