8000 gh-101609: Fix "‘state’ may be used uninitialized" warning in `_xxint… · python/cpython@262003f · GitHub
[go: up one dir, main page]

Skip to content

Commit 262003f

Browse files
authored
gh-101609: Fix "‘state’ may be used uninitialized" warning in _xxinterpchannelsmodule (GH-101610)
I went with the easiest solution: just removing the offending line. See the issue description with my reasoning. #101609
1 parent b96b344 commit 262003f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Modules/_xxinterpchannelsmodule.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ static int
174174
clear_module_state(module_state *state)
175175
{
176176
/* heap types */
177-
(void)_PyCrossInterpreterData_UnregisterClass(state->ChannelIDType);
177+
if (state->ChannelIDType != NULL) {
178+
(void)_PyCrossInterpreterData_UnregisterClass(state->ChannelIDType);
179+
}
178180
Py_CLEAR(state->ChannelIDType);
179181

180182
/* exceptions */
@@ -2269,7 +2271,6 @@ module_exec(PyObject *mod)
22692271
return 0;
22702272

22712273
error:
2272-
(void)_PyCrossInterpreterData_UnregisterClass(state->ChannelIDType);
22732274
_globals_fini();
22742275
return -1;
22752276
}

0 commit comments

Comments
 (0)
0