Skip to content

Commit 0d860dd

Browse files
benjaminppetdance
andauthored
[3.8] closes bpo-39630: Update pointers to string literals to be const char *. (GH-18511)
(cherry picked from commit 7386a70) Co-authored-by: Andy Lester <andy@petdance.com>
1 parent 28fc1ba commit 0d860dd

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Objects/genobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ static PyObject *gen_close(PyGenObject *, PyObject *);
1111
static PyObject *async_gen_asend_new(PyAsyncGenObject *, PyObject *);
1212
static PyObject *async_gen_athrow_new(PyAsyncGenObject *, PyObject *);
1313

14-
static char *NON_INIT_CORO_MSG = "can't send non-None value to a "
14+
static const char *NON_INIT_CORO_MSG = "can't send non-None value to a "
1515
"just-started coroutine";
1616

17-
static char *ASYNC_GEN_IGNORED_EXIT_MSG =
17+
static const char *ASYNC_GEN_IGNORED_EXIT_MSG =
1818
"async generator ignored GeneratorExit";
1919

2020
static inline int

Python/codecs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1415,7 +1415,7 @@ static PyObject *surrogateescape_errors(PyObject *self, PyObject *exc)
14151415
static int _PyCodecRegistry_Init(void)
14161416
{
14171417
static struct {
1418-
char *name;
1418+
const char *name;
14191419
PyMethodDef def;
14201420
} methods[] =
14211421
{

Python/errors.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ PyErr_SetFromErrnoWithFilenameObjects(PyObject *exc, PyObject *filenameObject, P
584584

585585
#ifndef MS_WINDOWS
586586
if (i != 0) {
587-
char *s = strerror(i);
587+
const char *s = strerror(i);
588588
message = PyUnicode_DecodeLocale(s, "surrogateescape");
589589
}
590590
else {

0 commit comments

Comments
 (0)