summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-11-06 23:43:05 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-11-06 23:43:05 (GMT)
commit53e9ec48e53840d2af24d7262908e6fc9837e856 (patch)
tree478e4dfbe1489a45b4a0c67c5247ca8d6430209f /Objects
parentad14ccd047022d09f486d2359a342ffc5e676e5a (diff)
downloadcpython-53e9ec48e53840d2af24d7262908e6fc9837e856.zip
cpython-53e9ec48e53840d2af24d7262908e6fc9837e856.tar.gz
cpython-53e9ec48e53840d2af24d7262908e6fc9837e856.tar.bz2
Issue #19512: Use the new _PyId_builtins identifier
Diffstat (limited to 'Objects')
-rw-r--r--Objects/object.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 8078623..9d96e86 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -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);