summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-08-04 16:43:59 (GMT)
committerGuido van Rossum <guido@python.org>2007-08-04 16:43:59 (GMT)
commit1e2b760475e20c2c293c0a78a608012d7d70e3b4 (patch)
treeafd1d32e0d349fbabb2b058647e63ce771f88c21
parent3e186154961c760422d04c2db47f80c3067ef749 (diff)
downloadcpython-1e2b760475e20c2c293c0a78a608012d7d70e3b4.zip
cpython-1e2b760475e20c2c293c0a78a608012d7d70e3b4.tar.gz
cpython-1e2b760475e20c2c293c0a78a608012d7d70e3b4.tar.bz2
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.
-rw-r--r--Objects/typeobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 8cf28fc..6bc6085 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -1579,7 +1579,8 @@ valid_identifier(PyObject *s)
if (n == 0)
n = 1;
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,
"__slots__ must be identifiers");
return 0;