mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Use identifier API for PyObject_GetAttrString.
This commit is contained in:
parent
794d567b17
commit
1ee1b6fe0d
28 changed files with 499 additions and 357 deletions
|
@ -247,10 +247,11 @@ show_warning(PyObject *filename, int lineno, PyObject *text, PyObject
|
|||
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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue