mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Fix some of the refleaks in test_capi (ported from 3.2)
This commit is contained in:
commit
84091bfa45
1 changed files with 7 additions and 3 deletions
|
@ -2213,10 +2213,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.");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue