mirror of
https://github.com/python/cpython.git
synced 2025-11-24 20:30:18 +00:00
Set type names earlier in posixmodule.c (#140168)
This commit is contained in:
parent
7ac94fcb1d
commit
4641925bf2
2 changed files with 19 additions and 10 deletions
|
|
@ -2471,7 +2471,7 @@ static PyStructSequence_Field stat_result_fields[] = {
|
|||
#endif
|
||||
|
||||
static PyStructSequence_Desc stat_result_desc = {
|
||||
"stat_result", /* name */
|
||||
"os.stat_result", /* name; see issue gh-63408 */
|
||||
stat_result__doc__, /* doc */
|
||||
stat_result_fields,
|
||||
10
|
||||
|
|
@ -2501,7 +2501,7 @@ static PyStructSequence_Field statvfs_result_fields[] = {
|
|||
};
|
||||
|
||||
static PyStructSequence_Desc statvfs_result_desc = {
|
||||
"statvfs_result", /* name */
|
||||
"os.statvfs_result", /* name; see issue gh-63408 */
|
||||
statvfs_result__doc__, /* doc */
|
||||
statvfs_result_fields,
|
||||
10
|
||||
|
|
@ -2526,7 +2526,7 @@ static PyStructSequence_Field waitid_result_fields[] = {
|
|||
};
|
||||
|
||||
static PyStructSequence_Desc waitid_result_desc = {
|
||||
"waitid_result", /* name */
|
||||
MODNAME ".waitid_result", /* name */
|
||||
waitid_result__doc__, /* doc */
|
||||
waitid_result_fields,
|
||||
5
|
||||
|
|
@ -8663,7 +8663,7 @@ static PyStructSequence_Field sched_param_fields[] = {
|
|||
};
|
||||
|
||||
static PyStructSequence_Desc sched_param_desc = {
|
||||
"sched_param", /* name */
|
||||
MODNAME ".sched_param", /* name */
|
||||
os_sched_param__doc__, /* doc */
|
||||
sched_param_fields,
|
||||
1
|
||||
|
|
@ -11057,7 +11057,7 @@ and elapsed.\n\
|
|||
See os.times for more information.");
|
||||
|
||||
static PyStructSequence_Desc times_result_desc = {
|
||||
"times_result", /* name */
|
||||
MODNAME ".times_result", /* name */
|
||||
times_result__doc__, /* doc */
|
||||
times_result_fields,
|
||||
5
|
||||
|
|
@ -18584,14 +18584,12 @@ posixmodule_exec(PyObject *m)
|
|||
}
|
||||
|
||||
#if defined(HAVE_WAITID)
|
||||
waitid_result_desc.name = MODNAME ".waitid_result";
|
||||
state->WaitidResultType = (PyObject *)PyStructSequence_NewType(&waitid_result_desc);
|
||||
if (PyModule_AddObjectRef(m, "waitid_result", state->WaitidResultType) < 0) {
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
stat_result_desc.name = "os.stat_result"; /* see issue #19209 */
|
||||
stat_result_desc.fields[7].name = PyStructSequence_UnnamedField;
|
||||
stat_result_desc.fields[8].name = PyStructSequence_UnnamedField;
|
||||
stat_result_desc.fields[9].name = PyStructSequence_UnnamedField;
|
||||
|
|
@ -18602,14 +18600,12 @@ posixmodule_exec(PyObject *m)
|
|||
state->statresult_new_orig = ((PyTypeObject *)state->StatResultType)->tp_new;
|
||||
((PyTypeObject *)state->StatResultType)->tp_new = statresult_new;
|
||||
|
||||
statvfs_result_desc.name = "os.statvfs_result"; /* see issue #19209 */
|
||||
state->StatVFSResultType = (PyObject *)PyStructSequence_NewType(&statvfs_result_desc);
|
||||
if (PyModule_AddObjectRef(m, "statvfs_result", state->StatVFSResultType) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM)
|
||||
sched_param_desc.name = MODNAME ".sched_param";
|
||||
state->SchedParamType = (PyObject *)PyStructSequence_NewType(&sched_param_desc);
|
||||
if (PyModule_AddObjectRef(m, "sched_param", state->SchedParamType) < 0) {
|
||||
return -1;
|
||||
|
|
@ -18641,7 +18637,6 @@ posixmodule_exec(PyObject *m)
|
|||
return -1;
|
||||
}
|
||||
|
||||
times_result_desc.name = MODNAME ".times_result";
|
||||
state->TimesResultType = (PyObject *)PyStructSequence_NewType(×_result_desc);
|
||||
if (PyModule_AddObjectRef(m, "times_result", state->TimesResultType) < 0) {
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue