Issue #3080: Use PyUnicode_InternFromString() for builtins
_PyImport_FixupBuiltin() and _PyImport_FindBuiltin() use PyUnicode_InternFromString() instead of PyUnicode_FromString().
This commit is contained in:
parent
9587286f98
commit
21fcd0c9af
|
@ -625,7 +625,7 @@ _PyImport_FixupBuiltin(PyObject *mod, char *name)
|
|||
{
|
||||
int res;
|
||||
PyObject *nameobj;
|
||||
nameobj = PyUnicode_FromString(name);
|
||||
nameobj = PyUnicode_InternFromString(name);
|
||||
if (nameobj == NULL)
|
||||
return -1;
|
||||
res = _PyImport_FixupExtensionObject(mod, nameobj, nameobj);
|
||||
|
@ -681,7 +681,7 @@ PyObject *
|
|||
_PyImport_FindBuiltin(const char *name)
|
||||
{
|
||||
PyObject *res, *nameobj;
|
||||
nameobj = PyUnicode_FromString(name);
|
||||
nameobj = PyUnicode_InternFromString(name);
|
||||
if (nameobj == NULL)
|
||||
return NULL;
|
||||
res = _PyImport_FindExtensionObject(nameobj, nameobj);
|
||||
|
|
Loading…
Reference in New Issue