File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -165,6 +165,10 @@ static int TYPE_ADD(PyObject *m)
165165 return ret ;
166166 }
167167
168+ TYPE .tp_base = & BufferType ;
169+ if (PyType_Ready (& TYPE ))
170+ return -1 ;
171+
168172 if (PyType_AddSizeConstant (& TYPE , "size" , sizeof (PTYPE )))
169173 return -1 ;
170174
@@ -192,7 +196,6 @@ static int TYPE_ADD(PyObject *m)
192196#endif
193197#endif
194198
195- TYPE .tp_base = & BufferType ;
196199 Py_INCREF (& BufferType );
197200 ret = PyModule_AddType (m , & TYPE );
198201 Py_DECREF (& BufferType );
Original file line number Diff line number Diff line change @@ -217,14 +217,17 @@ int LockType_Add(PyObject *m)
217217 return -1 ;
218218 }
219219
220+ LockType .tp_base = & BufferType ;
221+ if (PyType_Ready (& LockType ))
222+ return -1 ;
223+
220224 if (PyType_AddSizeConstant (& LockType , "size" , sizeof (pthread_mutex_t )))
221225 return -1 ;
222226
223227 if (PyType_AddSizeConstant (& LockType , "align" ,
224228 alignof(pthread_mutex_t )))
225229 return -1 ;
226230
227- LockType .tp_base = & BufferType ;
228231 Py_INCREF (& BufferType );
229232 err = PyModule_AddType (m , & LockType );
230233 Py_DECREF (& BufferType );
You can’t perform that action at this time.
0 commit comments