mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #19512: Use the new _PyId_builtins identifier
This commit is contained in:
parent
ad14ccd047
commit
53e9ec48e5
3 changed files with 8 additions and 4 deletions
|
@ -1122,8 +1122,12 @@ PyObject_SelfIter(PyObject *obj)
|
|||
PyObject *
|
||||
_PyObject_GetBuiltin(const char *name)
|
||||
{
|
||||
PyObject *mod, *attr;
|
||||
mod = PyImport_ImportModule("builtins");
|
||||
PyObject *mod_name, *mod, *attr;
|
||||
|
||||
mod_name = _PyUnicode_FromId(&_PyId_builtins); /* borrowed */
|
||||
if (mod_name == NULL)
|
||||
return NULL;
|
||||
mod = PyImport_Import(mod_name);
|
||||
if (mod == NULL)
|
||||
return NULL;
|
||||
attr = PyObject_GetAttrString(mod, name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue