_Py_Identifier are always ASCII strings

This commit is contained in:
Victor Stinner 2012-02-05 01:45:45 +01:00
parent e15ad2ff55
commit d446d8e09a
1 changed files with 2 additions and 3 deletions

View 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);