Commit 1e2b7604 authored by Guido van Rossum's avatar Guido van Rossum

Fix an obvious bug caused by a switch to Unicode.

However, this will need to be fixed further to allow non-ASCII letters in
names; leaving this to MvL.
parent 3e186154
...@@ -1579,7 +1579,8 @@ valid_identifier(PyObject *s) ...@@ -1579,7 +1579,8 @@ valid_identifier(PyObject *s)
if (n == 0) if (n == 0)
n = 1; n = 1;
for (i = 0; i < n; i++, p++) { for (i = 0; i < n; i++, p++) {
if (i > 255 || (!(i == 0 ? isalpha(*p) : isalnum(*p)) && *p != '_')) { if (*p > 127 ||
(!(i == 0 ? isalpha(*p) : isalnum(*p)) && *p != '_')) {
PyErr_SetString(PyExc_TypeError, PyErr_SetString(PyExc_TypeError,
"__slots__ must be identifiers"); "__slots__ must be identifiers");
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment