summaryrefslogtreecommitdiffstats
path: root/Objects/exceptions.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2020-04-11 07:48:40 (GMT)
committerGitHub <noreply@github.com>2020-04-11 07:48:40 (GMT)
commitcd8295ff758891f21084a6a5ad3403d35dda38f7 (patch)
treea77f829dea34198a7f36658c6e22baf4bc0bf5f5 /Objects/exceptions.c
parent7ec43a73092d43c6c95e7dd2669f49d54b57966f (diff)
downloadcpython-cd8295ff758891f21084a6a5ad3403d35dda38f7.zip
cpython-cd8295ff758891f21084a6a5ad3403d35dda38f7.tar.gz
cpython-cd8295ff758891f21084a6a5ad3403d35dda38f7.tar.bz2
bpo-39943: Add the const qualifier to pointers on non-mutable PyUnicode data. (GH-19345)
Diffstat (limited to 'Objects/exceptions.c')
-rw-r--r--Objects/exceptions.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 2baec5e..dad177a 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -1428,7 +1428,7 @@ my_basename(PyObject *name)
{
Py_ssize_t i, size, offset;
int kind;
- void *data;
+ const void *data;
if (PyUnicode_READY(name))
return NULL;
@@ -2953,7 +2953,7 @@ _check_for_legacy_statements(PySyntaxErrorObject *self, Py_ssize_t start)
static PyObject *exec_prefix = NULL;
Py_ssize_t text_len = PyUnicode_GET_LENGTH(self->text), match;
int kind = PyUnicode_KIND(self->text);
- void *data = PyUnicode_DATA(self->text);
+ const void *data = PyUnicode_DATA(self->text);
/* Ignore leading whitespace */
while (start < text_len) {