]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.8] closes bpo-39630: Update pointers to string literals to be const char *. (GH...
authorBenjamin Peterson <benjamin@python.org>
Fri, 14 Feb 2020 05:05:00 +0000 (21:05 -0800)
committerGitHub <noreply@github.com>
Fri, 14 Feb 2020 05:05:00 +0000 (21:05 -0800)
(cherry picked from commit 7386a70746cf9aaf2d95db75d9201fb124f085df)

Co-authored-by: Andy Lester <andy@petdance.com>
Objects/genobject.c
Python/codecs.c
Python/errors.c

index 2c06bdcc72642f71c21d3e6c86075d9367756950..ce7dd48a17cfb6ae36b36c99726520942b0a0c72 100644 (file)
@@ -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
index d4b34f8397f05a09fc3c158e689b2225a42ea434..4bd28ec9c761cae99ddef8047ac759ea38cf7828 100644 (file)
@@ -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[] =
     {
index 197d9779b390c7c469acd86c90c4b8343a01041f..1360c0d91a33fa3ccced80aa0fb09df9da34fd6d 100644 (file)
@@ -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 {