Mercurial > cpython-lru_cache-weakref
diff Python/sysmodule.c @ 72926:db4aa878cea2
Port SetAttrString/HasAttrString to SetAttrId/GetAttrId.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Fri, 14 Oct 2011 15:16:45 +0200 |
| parents | 7109f31300fb |
| children | 05e2bdc00c0c |
line wrap: on
line diff
--- a/Python/sysmodule.c Fri Oct 14 10:20:37 2011 +0200 +++ b/Python/sysmodule.c Fri Oct 14 15:16:45 2011 +0200 @@ -139,6 +139,7 @@ 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 @@ 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 @@ } 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;
