File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed
Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -2275,17 +2275,23 @@ PyUnicode_FromString(const char *u)
22752275PyObject *
22762276_PyUnicode_FromId (_Py_Identifier * id )
22772277{
2278- if (! id -> object ) {
2279- id -> object = PyUnicode_DecodeUTF8Stateful ( id -> string ,
2280- strlen ( id -> string ),
2281- NULL , NULL );
2282- if (! id -> object )
2283- return NULL ;
2284- PyUnicode_InternInPlace ( & id -> object );
2285- assert (! id -> next );
2286- id -> next = static_strings ;
2287- static_strings = id ;
2278+ if (id -> object ) {
2279+ return id -> object ;
2280+ }
2281+
2282+ PyObject * obj ;
2283+ obj = PyUnicode_DecodeUTF8Stateful ( id -> string ,
2284+ strlen ( id -> string ),
2285+ NULL , NULL );
2286+ if (! obj ) {
2287+ return NULL ;
22882288 }
2289+ PyUnicode_InternInPlace (& obj );
2290+
2291+ assert (!id -> next );
2292+ id -> object = obj ;
2293+ id -> next = static_strings ;
2294+ static_strings = id ;
22892295 return id -> object ;
22902296}
22912297
You can’t perform that action at this time.
0 commit comments