File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -2225,14 +2225,24 @@ static PyStructSequence_Desc waitid_result_desc = {
22252225 5
22262226};
22272227#endif
2228- static newfunc structseq_new ;
22292228
22302229static PyObject *
22312230statresult_new (PyTypeObject * type , PyObject * args , PyObject * kwds )
22322231{
22332232 PyStructSequence * result ;
22342233 int i ;
22352234
2235+ PyObject * mod = PyType_GetModule (type );
2236+ if (mod == NULL ) {
2237+ return NULL ;
2238+ }
2239+ _posixstate * state = get_posix_state (mod );
2240+ Py_DECREF (mod );
2241+ if (state != NULL ) {
2242+ return NULL ;
2243+ }
2244+ #define structseq_new ((PyTypeObject *)state->StatResultType)->tp_new
2245+
22362246 result = (PyStructSequence * )structseq_new (type , args , kwds );
22372247 if (!result )
22382248 return NULL ;
@@ -15909,7 +15919,6 @@ posixmodule_exec(PyObject *m)
1590915919 }
1591015920 PyModule_AddObject (m , "stat_result" , Py_NewRef (StatResultType ));
1591115921 state -> StatResultType = StatResultType ;
15912- structseq_new = ((PyTypeObject * )StatResultType )-> tp_new ;
1591315922 ((PyTypeObject * )StatResultType )-> tp_new = statresult_new ;
1591415923
1591515924 statvfs_result_desc .name = "os.statvfs_result" ; /* see issue #19209 */
Original file line number Diff line number Diff line change @@ -399,7 +399,6 @@ Modules/faulthandler.c - old_stack -
399399# initialized once
400400
401401Modules/_io/bufferedio.c _PyIO_trap_eintr eintr_int -
402- Modules/posixmodule.c - structseq_new -
403402Modules/posixmodule.c - ticks_per_second -
404403Modules/timemodule.c _PyTime_GetClockWithInfo initialized -
405404Modules/timemodule.c _PyTime_GetProcessTimeWithInfo ticks_per_second -
You can’t perform that action at this time.
0 commit comments