[3.7] bpo-36854: Fix reference counter in PyInit__testcapi() (GH-17338) by miss-islington · Pull Request #17339 · python/cpython
PyModule_AddIntConstant(m, "the_number_three", 3); PyObject *v; #ifdef WITH_PYMALLOC PyModule_AddObject(m, "WITH_PYMALLOC", Py_True); v = Py_True; #else PyModule_AddObject(m, "WITH_PYMALLOC", Py_False); v = Py_False; #endif Py_INCREF(v); PyModule_AddObject(m, "WITH_PYMALLOC", v);
TestError = PyErr_NewException("_testcapi.error", NULL, NULL); Py_INCREF(TestError);