mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
Use PyErr_WarnPy3k throughout
This commit is contained in:
parent
a692c4df63
commit
9f4f48114f
14 changed files with 47 additions and 88 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue