Use PyErr_WarnPy3k throughout
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index a77fd7d..a2b454a 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -1257,10 +1257,8 @@
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 @@
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);
}