@@ -11518,19 +11518,23 @@ INITFUNC(void)
1151811518 if (!initialized ) {
1151911519#if defined(HAVE_WAITID ) && !defined(__APPLE__ )
1152011520 waitid_result_desc .name = MODNAME ".waitid_result" ;
11521- PyStructSequence_InitType (& WaitidResultType , & waitid_result_desc );
11521+ if (PyStructSequence_InitType2 (& WaitidResultType , & waitid_result_desc ) < 0 )
11522+ return NULL ;
1152211523#endif
1152311524
1152411525 stat_result_desc .name = MODNAME ".stat_result" ;
1152511526 stat_result_desc .fields [7 ].name = PyStructSequence_UnnamedField ;
1152611527 stat_result_desc .fields [8 ].name = PyStructSequence_UnnamedField ;
1152711528 stat_result_desc .fields [9 ].name = PyStructSequence_UnnamedField ;
11528- PyStructSequence_InitType (& StatResultType , & stat_result_desc );
11529+ if (PyStructSequence_InitType2 (& StatResultType , & stat_result_desc ) < 0 )
11530+ return NULL ;
1152911531 structseq_new = StatResultType .tp_new ;
1153011532 StatResultType .tp_new = statresult_new ;
1153111533
1153211534 statvfs_result_desc .name = MODNAME ".statvfs_result" ;
11533- PyStructSequence_InitType (& StatVFSResultType , & statvfs_result_desc );
11535+ if (PyStructSequence_InitType2 (& StatVFSResultType ,
11536+ & statvfs_result_desc ) < 0 )
11537+ return NULL ;
1153411538#ifdef NEED_TICKS_PER_SECOND
1153511539# if defined(HAVE_SYSCONF ) && defined(_SC_CLK_TCK )
1153611540 ticks_per_second = sysconf (_SC_CLK_TCK );
@@ -11543,12 +11547,15 @@ INITFUNC(void)
1154311547
1154411548#if defined(HAVE_SCHED_SETPARAM ) || defined(HAVE_SCHED_SETSCHEDULER )
1154511549 sched_param_desc .name = MODNAME ".sched_param" ;
11546- PyStructSequence_InitType (& SchedParamType , & sched_param_desc );
11550+ if (PyStructSequence_InitType2 (& SchedParamType , & sched_param_desc ) < 0 )
11551+ return NULL ;
1154711552 SchedParamType .tp_new = sched_param_new ;
1154811553#endif
1154911554
1155011555 /* initialize TerminalSize_info */
11551- PyStructSequence_InitType (& TerminalSizeType , & TerminalSize_desc );
11556+ if (PyStructSequence_InitType2 (& TerminalSizeType ,
11557+ & TerminalSize_desc ) < 0 )
11558+ return NULL ;
1155211559 }
1155311560#if defined(HAVE_WAITID ) && !defined(__APPLE__ )
1155411561 Py_INCREF ((PyObject * ) & WaitidResultType );
@@ -11566,11 +11573,13 @@ INITFUNC(void)
1156611573#endif
1156711574
1156811575 times_result_desc .name = MODNAME ".times_result" ;
11569- PyStructSequence_InitType (& TimesResultType , & times_result_desc );
11576+ if (PyStructSequence_InitType2 (& TimesResultType , & times_result_desc ) < 0 )
11577+ return NULL ;
1157011578 PyModule_AddObject (m , "times_result" , (PyObject * )& TimesResultType );
1157111579
1157211580 uname_result_desc .name = MODNAME ".uname_result" ;
11573- PyStructSequence_InitType (& UnameResultType , & uname_result_desc );
11581+ if (PyStructSequence_InitType2 (& UnameResultType , & uname_result_desc ) < 0 )
11582+ return NULL ;
1157411583 PyModule_AddObject (m , "uname_result" , (PyObject * )& UnameResultType );
1157511584
1157611585#ifdef __APPLE__
@@ -11648,7 +11657,6 @@ INITFUNC(void)
1164811657 initialized = 1 ;
1164911658
1165011659 return m ;
11651-
1165211660}
1165311661
1165411662#ifdef __cplusplus
0 commit comments