summaryrefslogtreecommitdiffstats
path: root/Modules/_io
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_io')
-rw-r--r--Modules/_io/bufferedio.c2
-rw-r--r--Modules/_io/bytesio.c2
-rw-r--r--Modules/_io/iobase.c2
-rw-r--r--Modules/_io/stringio.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c
index 59e9beb..4f6dddb 100644
--- a/Modules/_io/bufferedio.c
+++ b/Modules/_io/bufferedio.c
@@ -83,7 +83,7 @@ _bufferediobase_readinto_generic(PyObject *self, Py_buffer *buffer, char readint
return NULL;
}
- len = Py_SIZE(data);
+ len = PyBytes_GET_SIZE(data);
if (len > buffer->len) {
PyErr_Format(PyExc_ValueError,
"read() returned too much data: "
diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c
index 59b917d..f78b447 100644
--- a/Modules/_io/bytesio.c
+++ b/Modules/_io/bytesio.c
@@ -822,7 +822,7 @@ bytesio_setstate(bytesio *self, PyObject *state)
/* We allow the state tuple to be longer than 3, because we may need
someday to extend the object's state without breaking
backward-compatibility. */
- if (!PyTuple_Check(state) || Py_SIZE(state) < 3) {
+ if (!PyTuple_Check(state) || PyTuple_GET_SIZE(state) < 3) {
PyErr_Format(PyExc_TypeError,
"%.200s.__setstate__ argument should be 3-tuple, got %.200s",
Py_TYPE(self)->tp_name, Py_TYPE(state)->tp_name);
diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c
index ee6ad47..b176457 100644
--- a/Modules/_io/iobase.c
+++ b/Modules/_io/iobase.c
@@ -518,7 +518,7 @@ _io__IOBase_readline_impl(PyObject *self, Py_ssize_t limit)
if (buffer == NULL)
return NULL;
- while (limit < 0 || Py_SIZE(buffer) < limit) {
+ while (limit < 0 || PyByteArray_GET_SIZE(buffer) < limit) {
Py_ssize_t nreadahead = 1;
PyObject *b;
diff --git a/Modules/_io/stringio.c b/Modules/_io/stringio.c
index a73171f..ef45032 100644
--- a/Modules/_io/stringio.c
+++ b/Modules/_io/stringio.c
@@ -877,7 +877,7 @@ stringio_setstate(stringio *self, PyObject *state)
/* We allow the state tuple to be longer than 4, because we may need
someday to extend the object's state without breaking
backward-compatibility. */
- if (!PyTuple_Check(state) || Py_SIZE(state) < 4) {
+ if (!PyTuple_Check(state) || PyTuple_GET_SIZE(state) < 4) {
PyErr_Format(PyExc_TypeError,
"%.200s.__setstate__ argument should be 4-tuple, got %.200s",
Py_TYPE(self)->tp_name, Py_TYPE(state)->tp_name);