Skip to content

Commit 7386a70

Browse files
authored
closes bpo-39630: Update pointers to string literals to be const char *. (GH-18510)
1 parent a9edf44 commit 7386a70

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Objects/frameobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno, void *Py_UNUSED(ignore
475475
if (new_stack.depth > current_stack.depth ||
476476
top_block(&new_stack)->start_line != current_block_at_new_depth->start_line) {
477477
unsigned char target_kind = top_block(&new_stack)->kind;
478-
char *msg;
478+
const char *msg;
479479
if (target_kind == POP_EXCEPT) {
480480
msg = "can't jump into an 'except' block as there's no exception";
481481
}

Objects/genobject.c

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

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

18-
static char *ASYNC_GEN_IGNORED_EXIT_MSG =
18+
static const char *ASYNC_GEN_IGNORED_EXIT_MSG =
1919
"async generator ignored GeneratorExit";
2020

2121
static inline int

Python/codecs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ static PyObject *surrogateescape_errors(PyObject *self, PyObject *exc)
14071407
static int _PyCodecRegistry_Init(void)
14081408
{
14091409
static struct {
1410-
char *name;
1410+
const char *name;
14111411
PyMethodDef def;
14121412
} methods[] =
14131413
{

Python/errors.c

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

615615
#ifndef MS_WINDOWS
616616
if (i != 0) {
617-
char *s = strerror(i);
617+
const char *s = strerror(i);
618618
message = PyUnicode_DecodeLocale(s, "surrogateescape");
619619
}
620620
else {

0 commit comments

Comments
 (0)