From: Guido van Rossum Date: Sat, 4 Aug 2007 16:43:59 +0000 (+0000) Subject: Fix an obvious bug caused by a switch to Unicode. X-Git-Tag: v3.0a1~527 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e2b760475e20c2c293c0a78a608012d7d70e3b4;p=python 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. --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 8cf28fca7f..6bc60854fa 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;