summaryrefslogtreecommitdiffstats
path: root/Objects/genobject.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-11-11 11:06:26 (GMT)
committerGitHub <noreply@github.com>2017-11-11 11:06:26 (GMT)
commite2f92de6a90ae11a6d8e01bd17fd88b005516835 (patch)
treea5bc255a98f488e5ecf195dc3f55665e9afecc47 /Objects/genobject.c
parente184cfd7bf8bcfd160e3b611d4351ca3ce52d9e2 (diff)
downloadcpython-e2f92de6a90ae11a6d8e01bd17fd88b005516835.zip
cpython-e2f92de6a90ae11a6d8e01bd17fd88b005516835.tar.gz
cpython-e2f92de6a90ae11a6d8e01bd17fd88b005516835.tar.bz2
Add the const qualifier to "char *" variables that refer to literal strings. (#4370)
Diffstat (limited to 'Objects/genobject.c')
-rw-r--r--Objects/genobject.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 7793a54..00a8823 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -152,7 +152,7 @@ gen_send_ex(PyGenObject *gen, PyObject *arg, int exc, int closing)
PyObject *result;
if (gen->gi_running) {
- char *msg = "generator already executing";
+ const char *msg = "generator already executing";
if (PyCoro_CheckExact(gen)) {
msg = "coroutine already executing";
}
@@ -186,8 +186,8 @@ gen_send_ex(PyGenObject *gen, PyObject *arg, int exc, int closing)
if (f->f_lasti == -1) {
if (arg && arg != Py_None) {
- char *msg = "can't send non-None value to a "
- "just-started generator";
+ const char *msg = "can't send non-None value to a "
+ "just-started generator";
if (PyCoro_CheckExact(gen)) {
msg = NON_INIT_CORO_MSG;
}
@@ -410,7 +410,7 @@ gen_close(PyGenObject *gen, PyObject *args)
PyErr_SetNone(PyExc_GeneratorExit);
retval = gen_send_ex(gen, Py_None, 1, 1);
if (retval) {
- char *msg = "generator ignored GeneratorExit";
+ const char *msg = "generator ignored GeneratorExit";
if (PyCoro_CheckExact(gen)) {
msg = "coroutine ignored GeneratorExit";
} else if (PyAsyncGen_CheckExact(gen)) {