summaryrefslogtreecommitdiffstats
path: root/Modules/_io
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2020-04-12 11:58:27 (GMT)
committerGitHub <noreply@github.com>2020-04-12 11:58:27 (GMT)
commit8f87eefe7f0576c05c488874eb9601a7a87c7312 (patch)
tree10ea36d1f702ae9e8bc34bcc88588868706948f6 /Modules/_io
parent3e0dd3730b5eff7e9ae6fb921aa77cd26efc9e3a (diff)
downloadcpython-8f87eefe7f0576c05c488874eb9601a7a87c7312.zip
cpython-8f87eefe7f0576c05c488874eb9601a7a87c7312.tar.gz
cpython-8f87eefe7f0576c05c488874eb9601a7a87c7312.tar.bz2
bpo-39943: Add the const qualifier to pointers on non-mutable PyBytes data. (GH-19472)
Diffstat (limited to 'Modules/_io')
-rw-r--r--Modules/_io/bytesio.c4
-rw-r--r--Modules/_io/textio.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c
index b5d308a..f4261b3 100644
--- a/Modules/_io/bytesio.c
+++ b/Modules/_io/bytesio.c
@@ -393,7 +393,7 @@ _io_BytesIO_tell_impl(bytesio *self)
static PyObject *
read_bytes(bytesio *self, Py_ssize_t size)
{
- char *output;
+ const char *output;
assert(self->buf != NULL);
assert(size <= self->string_size);
@@ -502,7 +502,7 @@ _io_BytesIO_readlines_impl(bytesio *self, PyObject *arg)
{
Py_ssize_t maxsize, size, n;
PyObject *result, *line;
- char *output;
+ const char *output;
CHECK_CLOSED(self);
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
index 12dba38..92d6faa 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -2640,7 +2640,7 @@ _io_TextIOWrapper_tell_impl(textio *self)
Py_ssize_t chars_to_skip, chars_decoded;
Py_ssize_t skip_bytes, skip_back;
PyObject *saved_state = NULL;
- char *input, *input_end;
+ const char *input, *input_end;
Py_ssize_t dec_buffer_len;
int dec_flags;