Issue #25923: Added the const qualifier to static constant arrays.

This commit is contained in:
Serhiy Storchaka 2015-12-25 19:53:18 +02:00
parent ea8c43152f
commit 2d06e84455
44 changed files with 139 additions and 134 deletions

View file

@ -870,7 +870,7 @@ get_operator(const node *n)
}
}
static const char* FORBIDDEN[] = {
static const char * const FORBIDDEN[] = {
"None",
"True",
"False",
@ -887,7 +887,7 @@ forbidden_name(struct compiling *c, identifier name, const node *n,
return 1;
}
if (full_checks) {
const char **p;
const char * const *p;
for (p = FORBIDDEN; *p; p++) {
if (PyUnicode_CompareWithASCIIString(name, *p) == 0) {
ast_error(c, n, "assignment to keyword");