Commit 55f217f2 authored by Antoine Pitrou's avatar Antoine Pitrou

Fix refleaks in test_capi

(this was easier than I thought!)
parent 6c40eb7f
......@@ -1959,10 +1959,14 @@ SimpleExtendsException(PyExc_Warning, ResourceWarning,
*/
PyObject *PyExc_RecursionErrorInst = NULL;
#define PRE_INIT(TYPE) if (PyType_Ready(&_PyExc_ ## TYPE) < 0) \
Py_FatalError("exceptions bootstrapping error.");
#define PRE_INIT(TYPE) \
if (!(_PyExc_ ## TYPE.tp_flags & Py_TPFLAGS_READY)) { \
if (PyType_Ready(&_PyExc_ ## TYPE) < 0) \
Py_FatalError("exceptions bootstrapping error."); \
Py_INCREF(PyExc_ ## TYPE); \
}
#define POST_INIT(TYPE) Py_INCREF(PyExc_ ## TYPE); \
#define POST_INIT(TYPE) \
if (PyDict_SetItemString(bdict, # TYPE, PyExc_ ## TYPE)) \
Py_FatalError("Module dictionary insertion problem.");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment