8000 gh-76785: Make interpreters.*Channel Objects Shareable (gh-110607) · python/cpython@d23a2f9 · GitHub
[go: up one dir, main page]

Skip to content

Commit d23a2f9

Browse files
gh-76785: Make interpreters.*Channel Objects Shareable (gh-110607)
This restores their shareability, which was disabled by gh-110318 due to ref leaks.
1 parent 6741d5a commit d23a2f9

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Lib/test/support/interpreters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,4 +264,4 @@ def close(self):
264264

265265

266266
# XXX This is causing leaks (gh-110318):
267-
#_channels._register_end_types(SendChannel, RecvChannel)
267+
_channels._register_end_types(SendChannel, RecvChannel)

Lib/test/test_interpreters.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,6 @@ def test_list_all(self):
833833
after = set(interpreters.list_all_channels())
834834
self.assertEqual(after, created)
835835

836-
@unittest.expectedFailure # See gh-110318:
837836
def test_shareable(self):
838837
rch, sch = interpreters.create_channel()
839838

Modules/_xxinterpchannelsmodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,10 @@ _get_current_module_state(void)
441441
static int
442442
traverse_module_state(module_state *state, visitproc visit, void *arg)
443443
{
444+
/* external types */
445+
Py_VISIT(state->send_channel_type);
446+
Py_VISIT(state->recv_channel_type);
447+
444448
/* heap types */
445449
Py_VISIT(state->ChannelInfoType);
446450
Py_VISIT(state->ChannelIDType);

0 commit comments

Comments
 (0)
0