Mercurial > cpython-lru_cache-weakref
diff Python/_warnings.c @ 72848:81380082d216
Use identifier API for PyObject_GetAttrString.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Mon, 10 Oct 2011 18:11:30 +0200 |
| parents | 5e33219492bc |
| children | 7109f31300fb |
line wrap: on
line diff
--- a/Python/_warnings.c Mon Oct 10 03:21:36 2011 +0200 +++ b/Python/_warnings.c Mon Oct 10 18:11:30 2011 +0200 @@ -247,10 +247,11 @@ PyObject *f_stderr; PyObject *name; char lineno_str[128]; + _Py_identifier(__name__); PyOS_snprintf(lineno_str, sizeof(lineno_str), ":%d: ", lineno); - name = PyObject_GetAttrString(category, "__name__"); + name = _PyObject_GetAttrId(category, &PyId___name__); if (name == NULL) /* XXX Can an object lack a '__name__' attribute? */ return;
