mirror of https://github.com/python/cpython.git
A little reformating of Py3k warnings
This commit is contained in:
parent
fe4948bcef
commit
f19a7b90bd
|
@ -279,9 +279,8 @@ BaseException_get_message(PyBaseExceptionObject *self)
|
||||||
int ret;
|
int ret;
|
||||||
ret = PyErr_WarnEx(PyExc_DeprecationWarning,
|
ret = PyErr_WarnEx(PyExc_DeprecationWarning,
|
||||||
"BaseException.message has been deprecated as "
|
"BaseException.message has been deprecated as "
|
||||||
"of Python 2.6",
|
"of Python 2.6", 1);
|
||||||
1);
|
if (ret < 0)
|
||||||
if (ret == -1)
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
Py_INCREF(self->message);
|
Py_INCREF(self->message);
|
||||||
|
@ -294,9 +293,8 @@ BaseException_set_message(PyBaseExceptionObject *self, PyObject *val)
|
||||||
int ret;
|
int ret;
|
||||||
ret = PyErr_WarnEx(PyExc_DeprecationWarning,
|
ret = PyErr_WarnEx(PyExc_DeprecationWarning,
|
||||||
"BaseException.message has been deprecated as "
|
"BaseException.message has been deprecated as "
|
||||||
"of Python 2.6",
|
"of Python 2.6", 1);
|
||||||
1);
|
if (ret < 0)
|
||||||
if (ret == -1)
|
|
||||||
return -1;
|
return -1;
|
||||||
Py_INCREF(val);
|
Py_INCREF(val);
|
||||||
Py_DECREF(self->message);
|
Py_DECREF(self->message);
|
||||||
|
|
|
@ -627,8 +627,9 @@ file_seek(PyFileObject *f, PyObject *args)
|
||||||
return NULL;
|
return NULL;
|
||||||
/* Deprecated in 2.6 */
|
/* Deprecated in 2.6 */
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
if (PyErr_Warn(PyExc_DeprecationWarning,
|
if (PyErr_WarnEx(PyExc_DeprecationWarning,
|
||||||
"integer argument expected, got float"))
|
"integer argument expected, got float",
|
||||||
|
1) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
off_index = offobj;
|
off_index = offobj;
|
||||||
Py_INCREF(offobj);
|
Py_INCREF(offobj);
|
||||||
|
|
|
@ -352,9 +352,8 @@ Py_FindMethodInChain(PyMethodChain *chain, PyObject *self, const char *name)
|
||||||
{
|
{
|
||||||
if (name[0] == '_' && name[1] == '_') {
|
if (name[0] == '_' && name[1] == '_') {
|
||||||
if (strcmp(name, "__methods__") == 0) {
|
if (strcmp(name, "__methods__") == 0) {
|
||||||
if (Py_Py3kWarningFlag &&
|
if (PyErr_WarnPy3k("__methods__ not supported in 3.x",
|
||||||
PyErr_Warn(PyExc_DeprecationWarning,
|
1) < 0)
|
||||||
"__methods__ not supported in 3.x") < 0)
|
|
||||||
return NULL;
|
return NULL;
|
||||||
return listmethodchain(chain);
|
return listmethodchain(chain);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3166,7 +3166,7 @@ do_raise(PyObject *type, PyObject *value, PyObject *tb)
|
||||||
if (Py_Py3kWarningFlag && PyClass_Check(type)) {
|
if (Py_Py3kWarningFlag && PyClass_Check(type)) {
|
||||||
if (PyErr_WarnEx(PyExc_DeprecationWarning,
|
if (PyErr_WarnEx(PyExc_DeprecationWarning,
|
||||||
"exceptions must derive from BaseException "
|
"exceptions must derive from BaseException "
|
||||||
"in 3.x", 1) == -1)
|
"in 3.x", 1) < 0)
|
||||||
goto raise_error;
|
goto raise_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4092,7 +4092,7 @@ cmp_outcome(int op, register PyObject *v, register PyObject *w)
|
||||||
PyExc_DeprecationWarning,
|
PyExc_DeprecationWarning,
|
||||||
"catching of string "
|
"catching of string "
|
||||||
"exceptions is deprecated", 1);
|
"exceptions is deprecated", 1);
|
||||||
if (ret_val == -1)
|
if (ret_val < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else if (Py_Py3kWarningFlag &&
|
else if (Py_Py3kWarningFlag &&
|
||||||
|
@ -4103,7 +4103,7 @@ cmp_outcome(int op, register PyObject *v, register PyObject *w)
|
||||||
ret_val = PyErr_WarnEx(
|
ret_val = PyErr_WarnEx(
|
||||||
PyExc_DeprecationWarning,
|
PyExc_DeprecationWarning,
|
||||||
CANNOT_CATCH_MSG, 1);
|
CANNOT_CATCH_MSG, 1);
|
||||||
if (ret_val == -1)
|
if (ret_val < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4115,7 +4115,7 @@ cmp_outcome(int op, register PyObject *v, register PyObject *w)
|
||||||
PyExc_DeprecationWarning,
|
PyExc_DeprecationWarning,
|
||||||
"catching of string "
|
"catching of string "
|
||||||
"exceptions is deprecated", 1);
|
"exceptions is deprecated", 1);
|
||||||
if (ret_val == -1)
|
if (ret_val < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else if (Py_Py3kWarningFlag &&
|
else if (Py_Py3kWarningFlag &&
|
||||||
|
@ -4126,7 +4126,7 @@ cmp_outcome(int op, register PyObject *v, register PyObject *w)
|
||||||
ret_val = PyErr_WarnEx(
|
ret_val = PyErr_WarnEx(
|
||||||
PyExc_DeprecationWarning,
|
PyExc_DeprecationWarning,
|
||||||
CANNOT_CATCH_MSG, 1);
|
CANNOT_CATCH_MSG, 1);
|
||||||
if (ret_val == -1)
|
if (ret_val < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue