Use PyErr_WarnPy3k throughout

This commit is contained in:
Benjamin Peterson 2008-04-27 03:01:45 +00:00
parent a692c4df63
commit 9f4f48114f
14 changed files with 47 additions and 88 deletions

View file

@ -1257,10 +1257,8 @@ array. Also called as read.");
static PyObject *
array_fromfile_as_read(arrayobject *self, PyObject *args)
{
if (Py_Py3kWarningFlag &&
PyErr_Warn(PyExc_DeprecationWarning,
"array.read() not supported in 3.x; "
"use array.fromfile()") < 0)
if (PyErr_WarnPy3k("array.read() not supported in 3.x; "
"use array.fromfile()", 1) < 0)
return NULL;
return array_fromfile(self, args);
}
@ -1298,10 +1296,8 @@ write.");
static PyObject *
array_tofile_as_write(arrayobject *self, PyObject *f)
{
if (Py_Py3kWarningFlag &&
PyErr_Warn(PyExc_DeprecationWarning,
"array.write() not supported in 3.x; "
"use array.tofile()") < 0)
if (PyErr_WarnPy3k("array.write() not supported in 3.x; "
"use array.tofile()", 1) < 0)
return NULL;
return array_tofile(self, f);
}