]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
closes bpo-39630: Update pointers to string literals to be const char *. (GH-18510)
authorAndy Lester <andy@petdance.com>
Fri, 14 Feb 2020 04:42:56 +0000 (22:42 -0600)
committerGitHub <noreply@github.com>
Fri, 14 Feb 2020 04:42:56 +0000 (20:42 -0800)
Objects/frameobject.c
Objects/genobject.c
Python/codecs.c
Python/errors.c

index 4469e3c20cd2f34dd889e2cb5a2ee5e2faa71472..64f5754fe201374498e99571c39981b8fdf0df66 100644 (file)
@@ -475,7 +475,7 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno, void *Py_UNUSED(ignore
         if (new_stack.depth > current_stack.depth ||
             top_block(&new_stack)->start_line != current_block_at_new_depth->start_line) {
             unsigned char target_kind = top_block(&new_stack)->kind;
-            char *msg;
+            const char *msg;
             if (target_kind == POP_EXCEPT) {
                 msg = "can't jump into an 'except' block as there's no exception";
             }
index 0837698fd784c9579eed81f24feb1995fde38920..ef892bb0366b8899b82af4781c8049cebd36dcb8 100644 (file)
@@ -12,10 +12,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 ce86cb20cccccf77acf8c46e3a63bcc568c83793..e5bcdb09fc596b800c389b62aacd805584feac20 100644 (file)
@@ -1407,7 +1407,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 f11b66e7958ea2e349bbf5f2ddc0c661717af71f..61dc597916d72ac4fea406c100add75e000d9f37 100644 (file)
@@ -614,7 +614,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 {