mirror of https://github.com/python/cpython
gh-113787: Fix refleaks in test_capi (gh-113816)
Fix refleaks and a typo.
This commit is contained in:
parent
61dd77b04e
commit
ace4d7ff9a
|
@ -195,6 +195,6 @@ _PyTestCapi_Init_VectorcallLimited(PyObject *m) {
|
|||
if (PyModule_AddType(m, (PyTypeObject *)LimitedVectorCallClass) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
Py_DECREF(LimitedVectorCallClass);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ get_testcapi_state(PyObject *module)
|
|||
|
||||
static PyObject *
|
||||
get_testerror(PyObject *self) {
|
||||
testcapistate_t *state = get_testcapi_state((PyObject *)Py_TYPE(self));
|
||||
testcapistate_t *state = get_testcapi_state(self);
|
||||
return state->error;
|
||||
}
|
||||
|
||||
|
@ -3947,7 +3947,6 @@ PyInit__testcapi(void)
|
|||
|
||||
testcapistate_t *state = get_testcapi_state(m);
|
||||
state->error = PyErr_NewException("_testcapi.error", NULL, NULL);
|
||||
Py_INCREF(state->error);
|
||||
PyModule_AddObject(m, "error", state->error);
|
||||
|
||||
if (PyType_Ready(&ContainerNoGC_type) < 0) {
|
||||
|
|
Loading…
Reference in New Issue