mirror of https://github.com/python/cpython
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;
|
int res;
|
||||||
PyObject *nameobj;
|
PyObject *nameobj;
|
||||||
nameobj = PyUnicode_FromString(name);
|
nameobj = PyUnicode_InternFromString(name);
|
||||||
if (nameobj == NULL)
|
if (nameobj == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
res = _PyImport_FixupExtensionObject(mod, nameobj, nameobj);
|
res = _PyImport_FixupExtensionObject(mod, nameobj, nameobj);
|
||||||
|
@ -681,7 +681,7 @@ PyObject *
|
||||||
_PyImport_FindBuiltin(const char *name)
|
_PyImport_FindBuiltin(const char *name)
|
||||||
{
|
{
|
||||||
PyObject *res, *nameobj;
|
PyObject *res, *nameobj;
|
||||||
nameobj = PyUnicode_FromString(name);
|
nameobj = PyUnicode_InternFromString(name);
|
||||||
if (nameobj == NULL)
|
if (nameobj == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
res = _PyImport_FindExtensionObject(nameobj, nameobj);
|
res = _PyImport_FindExtensionObject(nameobj, nameobj);
|
||||||
|
|
Loading…
Reference in New Issue