From 262003fd3297f7f4ee09cebd1abb225066412ce7 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Tue, 7 Feb 2023 00:05:41 +0300 Subject: [PATCH] =?utf8?q?gh-101609:=20Fix=20"=E2=80=98state=E2=80=99=20ma?= =?utf8?q?y=20be=20used=20uninitialized"=20warning=20in=20`=5Fxxinterpchan?= =?utf8?q?nelsmodule`=20(GH-101610)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit I went with the easiest solution: just removing the offending line. See the issue description with my reasoning. https://github.com/python/cpython/issues/101609 --- Modules/_xxinterpchannelsmodule.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Modules/_xxinterpchannelsmodule.c b/Modules/_xxinterpchannelsmodule.c index 8601a189e875..60538c318748 100644 --- a/Modules/_xxinterpchannelsmodule.c +++ b/Modules/_xxinterpchannelsmodule.c @@ -174,7 +174,9 @@ static int clear_module_state(module_state *state) { /* heap types */ - (void)_PyCrossInterpreterData_UnregisterClass(state->ChannelIDType); + if (state->ChannelIDType != NULL) { + (void)_PyCrossInterpreterData_UnregisterClass(state->ChannelIDType); + } Py_CLEAR(state->ChannelIDType); /* exceptions */ @@ -2269,7 +2271,6 @@ module_exec(PyObject *mod) return 0; error: - (void)_PyCrossInterpreterData_UnregisterClass(state->ChannelIDType); _globals_fini(); return -1; } -- 2.47.3