Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d446d8e

Browse files
author
Victor Stinner
committed
_Py_Identifier are always ASCII strings
1 parent e15ad2f commit d446d8e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Objects/unicodeobject.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,9 +1744,8 @@ PyObject *
17441744
_PyUnicode_FromId(_Py_Identifier *id)
17451745
{
17461746
if (!id->object) {
1747-
id->object = PyUnicode_DecodeUTF8Stateful(id->string,
1748-
strlen(id->string),
1749-
NULL, NULL);
1747+
id->object = unicode_fromascii((unsigned char*)id->string,
1748+
strlen(id->string));
17501749
if (!id->object)
17511750
return NULL;
17521751
PyUnicode_InternInPlace(&id->object);

0 commit comments

Comments
 (0)