]> granicus.if.org Git - python/commitdiff
Fix an obvious bug caused by a switch to Unicode.
authorGuido van Rossum <guido@python.org>
Sat, 4 Aug 2007 16:43:59 +0000 (16:43 +0000)
committerGuido van Rossum <guido@python.org>
Sat, 4 Aug 2007 16:43:59 +0000 (16:43 +0000)
However, this will need to be fixed further to allow non-ASCII letters in
names; leaving this to MvL.

Objects/typeobject.c

index 8cf28fca7fd9296cb0cc87ede70382cbe9c66425..6bc60854fab970caff7c4aadeff20ab0d9fbffba 100644 (file)
@@ -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;