closes bpo-39630: Update pointers to string literals to be const char *. (GH-18510)
This commit is contained in:
parent
a9edf44a2d
commit
7386a70746
|
@ -475,7 +475,7 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno, void *Py_UNUSED(ignore
|
||||||
if (new_stack.depth > current_stack.depth ||
|
if (new_stack.depth > current_stack.depth ||
|
||||||
top_block(&new_stack)->start_line != current_block_at_new_depth->start_line) {
|
top_block(&new_stack)->start_line != current_block_at_new_depth->start_line) {
|
||||||
unsigned char target_kind = top_block(&new_stack)->kind;
|
unsigned char target_kind = top_block(&new_stack)->kind;
|
||||||
char *msg;
|
const char *msg;
|
||||||
if (target_kind == POP_EXCEPT) {
|
if (target_kind == POP_EXCEPT) {
|
||||||
msg = "can't jump into an 'except' block as there's no exception";
|
msg = "can't jump into an 'except' block as there's no exception";
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,10 +12,10 @@ static PyObject *gen_close(PyGenObject *, PyObject *);
|
||||||
static PyObject *async_gen_asend_new(PyAsyncGenObject *, PyObject *);
|
static PyObject *async_gen_asend_new(PyAsyncGenObject *, PyObject *);
|
||||||
static PyObject *async_gen_athrow_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";
|
"just-started coroutine";
|
||||||
|
|
||||||
static char *ASYNC_GEN_IGNORED_EXIT_MSG =
|
static const char *ASYNC_GEN_IGNORED_EXIT_MSG =
|
||||||
"async generator ignored GeneratorExit";
|
"async generator ignored GeneratorExit";
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
|
|
|
@ -1407,7 +1407,7 @@ static PyObject *surrogateescape_errors(PyObject *self, PyObject *exc)
|
||||||
static int _PyCodecRegistry_Init(void)
|
static int _PyCodecRegistry_Init(void)
|
||||||
{
|
{
|
||||||
static struct {
|
static struct {
|
||||||
char *name;
|
const char *name;
|
||||||
PyMethodDef def;
|
PyMethodDef def;
|
||||||
} methods[] =
|
} methods[] =
|
||||||
{
|
{
|
||||||
|
|
|
@ -614,7 +614,7 @@ PyErr_SetFromErrnoWithFilenameObjects(PyObject *exc, PyObject *filenameObject, P
|
||||||
|
|
||||||
#ifndef MS_WINDOWS
|
#ifndef MS_WINDOWS
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
char *s = strerror(i);
|
const char *s = strerror(i);
|
||||||
message = PyUnicode_DecodeLocale(s, "surrogateescape");
|
message = PyUnicode_DecodeLocale(s, "surrogateescape");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue