diff options
author | Benjamin Peterson <benjamin@python.org> | 2020-02-13 21:05:00 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-13 21:05:00 -0800 |
commit | 0d860dd43c72dc7046a5d18fc72d495cadd4a2df (patch) | |
tree | fe13da348427ff9ffb9c6ceb10cd0c291a0b733e | |
parent | 28fc1bac0fbe1f4ae2e3dcba1dee38d2c063a539 (diff) | |
download | cpython-git-0d860dd43c72dc7046a5d18fc72d495cadd4a2df.tar.gz |
[3.8] closes bpo-39630: Update pointers to string literals to be const char *. (GH-18511)
(cherry picked from commit 7386a70746cf9aaf2d95db75d9201fb124f085df)
Co-authored-by: Andy Lester <andy@petdance.com>
-rw-r--r-- | Objects/genobject.c | 4 | ||||
-rw-r--r-- | Python/codecs.c | 2 | ||||
-rw-r--r-- | Python/errors.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c index 2c06bdcc72..ce7dd48a17 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -11,10 +11,10 @@ static PyObject *gen_close(PyGenObject *, PyObject *); static PyObject *async_gen_asend_new(PyAsyncGenObject *, PyObject *); static PyObject *async_gen_athrow_new(PyAsyncGenObject *, PyObject *); -static char *NON_INIT_CORO_MSG = "can't send non-None value to a " +static const char *NON_INIT_CORO_MSG = "can't send non-None value to a " "just-started coroutine"; -static char *ASYNC_GEN_IGNORED_EXIT_MSG = +static const char *ASYNC_GEN_IGNORED_EXIT_MSG = "async generator ignored GeneratorExit"; static inline int diff --git a/Python/codecs.c b/Python/codecs.c index d4b34f8397..4bd28ec9c7 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -1415,7 +1415,7 @@ static PyObject *surrogateescape_errors(PyObject *self, PyObject *exc) static int _PyCodecRegistry_Init(void) { static struct { - char *name; + const char *name; PyMethodDef def; } methods[] = { diff --git a/Python/errors.c b/Python/errors.c index 197d9779b3..1360c0d91a 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -584,7 +584,7 @@ PyErr_SetFromErrnoWithFilenameObjects(PyObject *exc, PyObject *filenameObject, P #ifndef MS_WINDOWS if (i != 0) { - char *s = strerror(i); + const char *s = strerror(i); message = PyUnicode_DecodeLocale(s, "surrogateescape"); } else { |