mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-76785: Make interpreters.*Channel Objects Shareable (gh-110607)
This restores their shareability, which was disabled by gh-110318 due to ref leaks.
This commit is contained in:
parent
6741d5af32
commit
d23a2f9887
3 changed files with 5 additions and 2 deletions
|
@ -264,4 +264,4 @@ class SendChannel(_ChannelEnd):
|
||||||
|
|
||||||
|
|
||||||
# XXX This is causing leaks (gh-110318):
|
# XXX This is causing leaks (gh-110318):
|
||||||
#_channels._register_end_types(SendChannel, RecvChannel)
|
_channels._register_end_types(SendChannel, RecvChannel)
|
||||||
|
|
|
@ -833,7 +833,6 @@ class TestChannels(TestBase):
|
||||||
after = set(interpreters.list_all_channels())
|
after = set(interpreters.list_all_channels())
|
||||||
self.assertEqual(after, created)
|
self.assertEqual(after, created)
|
||||||
|
|
||||||
@unittest.expectedFailure # See gh-110318:
|
|
||||||
def test_shareable(self):
|
def test_shareable(self):
|
||||||
rch, sch = interpreters.create_channel()
|
rch, sch = interpreters.create_channel()
|
||||||
|
|
||||||
|
|
|
@ -441,6 +441,10 @@ _get_current_module_state(void)
|
||||||
static int
|
static int
|
||||||
traverse_module_state(module_state *state, visitproc visit, void *arg)
|
traverse_module_state(module_state *state, visitproc visit, void *arg)
|
||||||
{
|
{
|
||||||
|
/* external types */
|
||||||
|
Py_VISIT(state->send_channel_type);
|
||||||
|
Py_VISIT(state->recv_channel_type);
|
||||||
|
|
||||||
/* heap types */
|
/* heap types */
|
||||||
Py_VISIT(state->ChannelInfoType);
|
Py_VISIT(state->ChannelInfoType);
|
||||||
Py_VISIT(state->ChannelIDType);
|
Py_VISIT(state->ChannelIDType);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue