From d446d8e09a76ce0009d76e2b0c1729e1be7c7da8 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sun, 5 Feb 2012 01:45:45 +0100 Subject: [PATCH] _Py_Identifier are always ASCII strings --- Objects/unicodeobject.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 67336bf9f1..f13a1de563 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -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); -- 2.40.0