aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2020-04-12 14:58:27 +0300
committerGitHub <noreply@github.com>2020-04-12 14:58:27 +0300
commit8f87eefe7f0576c05c488874eb9601a7a87c7312 (patch)
tree10ea36d1f702ae9e8bc34bcc88588868706948f6 /Modules/_struct.c
parentcloses bpo-39953: Update OpenSSL error codes table. (GH-19082) (diff)
downloadcpython-8f87eefe7f0576c05c488874eb9601a7a87c7312.tar.gz
cpython-8f87eefe7f0576c05c488874eb9601a7a87c7312.tar.bz2
cpython-8f87eefe7f0576c05c488874eb9601a7a87c7312.zip
bpo-39943: Add the const qualifier to pointers on non-mutable PyBytes data. (GH-19472)
Diffstat (limited to 'Modules/_struct.c')
-rw-r--r--Modules/_struct.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 242ca9c10df..82ac0a19208 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -1785,7 +1785,7 @@ s_pack_internal(PyStructObject *soself, PyObject *const *args, int offset, char*
if (e->format == 's') {
Py_ssize_t n;
int isstring;
- void *p;
+ const void *p;
isstring = PyBytes_Check(v);
if (!isstring && !PyByteArray_Check(v)) {
PyErr_SetString(_structmodulestate_global->StructError,
@@ -1807,7 +1807,7 @@ s_pack_internal(PyStructObject *soself, PyObject *const *args, int offset, char*
} else if (e->format == 'p') {
Py_ssize_t n;
int isstring;
- void *p;
+ const void *p;
isstring = PyBytes_Check(v);
if (!isstring && !PyByteArray_Check(v)) {
PyErr_SetString(_structmodulestate_global->StructError,