mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +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
|
@ -6103,6 +6103,7 @@ wait_helper(pid_t pid, int status, struct rusage *ru)
|
|||
{
|
||||
PyObject *result;
|
||||
static PyObject *struct_rusage;
|
||||
_Py_identifier(struct_rusage);
|
||||
|
||||
if (pid == -1)
|
||||
return posix_error();
|
||||
|
@ -6111,7 +6112,7 @@ wait_helper(pid_t pid, int status, struct rusage *ru)
|
|||
PyObject *m = PyImport_ImportModuleNoBlock("resource");
|
||||
if (m == NULL)
|
||||
return NULL;
|
||||
struct_rusage = PyObject_GetAttrString(m, "struct_rusage");
|
||||
struct_rusage = _PyObject_GetAttrId(m, &PyId_struct_rusage);
|
||||
Py_DECREF(m);
|
||||
if (struct_rusage == NULL)
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue