diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2011-10-14 13:16:45 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2011-10-14 13:16:45 (GMT) |
commit | 1c67dd9b154d57baf58ed081767e199af1e84923 (patch) | |
tree | 0d6c95e99785f9b8381c808a5cb433adf319eda5 /Python/sysmodule.c | |
parent | bd928fef428e48084ff29ece0e21d07ad86d0793 (diff) | |
download | cpython-1c67dd9b154d57baf58ed081767e199af1e84923.zip cpython-1c67dd9b154d57baf58ed081767e199af1e84923.tar.gz cpython-1c67dd9b154d57baf58ed081767e199af1e84923.tar.bz2 |
Port SetAttrString/HasAttrString to SetAttrId/GetAttrId.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 7a1933d..6911c9a 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -139,6 +139,7 @@ sys_displayhook(PyObject *self, PyObject *o) PyObject *modules = interp->modules; PyObject *builtins = PyDict_GetItemString(modules, "builtins"); int err; + _Py_IDENTIFIER(_); if (builtins == NULL) { PyErr_SetString(PyExc_RuntimeError, "lost builtins module"); @@ -152,7 +153,7 @@ sys_displayhook(PyObject *self, PyObject *o) Py_INCREF(Py_None); return Py_None; } - if (PyObject_SetAttrString(builtins, "_", Py_None) != 0) + if (_PyObject_SetAttrId(builtins, &PyId__, Py_None) != 0) return NULL; outf = PySys_GetObject("stdout"); if (outf == NULL || outf == Py_None) { @@ -174,7 +175,7 @@ sys_displayhook(PyObject *self, PyObject *o) } if (PyFile_WriteString("\n", outf) != 0) return NULL; - if (PyObject_SetAttrString(builtins, "_", o) != 0) + if (_PyObject_SetAttrId(builtins, &PyId__, o) != 0) return NULL; Py_INCREF(Py_None); return Py_None; |