]> granicus.if.org Git - python/commitdiff
_Py_Identifier are always ASCII strings
authorVictor Stinner <victor.stinner@haypocalc.com>
Sun, 5 Feb 2012 00:45:45 +0000 (01:45 +0100)
committerVictor Stinner <victor.stinner@haypocalc.com>
Sun, 5 Feb 2012 00:45:45 +0000 (01:45 +0100)
Objects/unicodeobject.c

index 67336bf9f19b7201749c866f041f11ac7ad253cd..f13a1de563aa2b82a1c70597ae4d7f48425b89b7 100644 (file)
@@ -1744,9 +1744,8 @@ PyObject *
 _PyUnicode_FromId(_Py_Identifier *id)
 {
     if (!id->object) {
-        id->object = PyUnicode_DecodeUTF8Stateful(id->string,
-                                                  strlen(id->string),
-                                                  NULL, NULL);
+        id->object = unicode_fromascii((unsigned char*)id->string,
+                                       strlen(id->string));
         if (!id->object)
             return NULL;
         PyUnicode_InternInPlace(&id->object);