8000 gh-115490: Make the interpreter.channels and interpreter.queues Modules Handle Reloading Properly by ericsnowcurrently · Pull Request #115493 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-115490: Make the interpreter.channels and interpreter.queues Modules Handle Reloading Properly #115493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Prev Previous commit
Next Next commit
Properly clean up in set_channelend_types().
  • Loading branch information
ericsnowcurrently committed Feb 15, 2024
commit 9c0fd58eec8f048d561b35add59698e1f85937e5
7 changes: 6 additions & 1 deletion Modules/_xxinterpchannelsmodule.c
8626
Original file line number Diff line number Diff line change
Expand Up @@ -2709,13 +2709,18 @@ set_channelend_types(PyObject *mod, PyTypeObject *send, PyTypeObject *recv)
Py_CLEAR(state->recv_channel_type);
}

// Add and register the types.
state->send_channel_type = (PyTypeObject *)Py_NewRef(send);
state->recv_channel_type = (PyTypeObject *)Py_NewRef(recv);

if (register_xid_class(send, _channelend_shared, xid_classes)) {
Py_CLEAR(state->send_channel_type);
Py_CLEAR(state->recv_channel_type);
return -1;
}
if (register_xid_class(recv, _channelend_shared, xid_classes)) {
(void)_PyCrossInterpreterData_UnregisterClass(state->send_channel_type);
Py_CLEAR(state->send_channel_type);
Py_CLEAR(state->recv_channel_type);
return -1;
}

Expand Down
0