mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
gh-113787: Fix refleaks in test_capi (gh-113816)
Fix refleaks and a typo.
This commit is contained in:
parent
61dd77b04e
commit
ace4d7ff9a
2 changed files with 2 additions and 3 deletions
|
@ -195,6 +195,6 @@ _PyTestCapi_Init_VectorcallLimited(PyObject *m) {
|
||||||
if (PyModule_AddType(m, (PyTypeObject *)LimitedVectorCallClass) < 0) {
|
if (PyModule_AddType(m, (PyTypeObject *)LimitedVectorCallClass) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Py_DECREF(LimitedVectorCallClass);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ get_testcapi_state(PyObject *module)
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
get_testerror(PyObject *self) {
|
get_testerror(PyObject *self) {
|
||||||
testcapistate_t *state = get_testcapi_state((PyObject *)Py_TYPE(self));
|
testcapistate_t *state = get_testcapi_state(self);
|
||||||
return state->error;
|
return state->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3947,7 +3947,6 @@ PyInit__testcapi(void)
|
||||||
|
|
||||||
testcapistate_t *state = get_testcapi_state(m);
|
testcapistate_t *state = get_testcapi_state(m);
|
||||||
state->error = PyErr_NewException("_testcapi.error", NULL, NULL);
|
state->error = PyErr_NewException("_testcapi.error", NULL, NULL);
|
||||||
Py_INCREF(state->error);
|
|
||||||
PyModule_AddObject(m, "error", state->error);
|
PyModule_AddObject(m, "error", state->error);
|
||||||
|
|
||||||
if (PyType_Ready(&ContainerNoGC_type) < 0) {
|
if (PyType_Ready(&ContainerNoGC_type) < 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue