File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
Lib/test/test_interpreters Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ def test_list_all(self):
4848 self.assertEqual(after, created)
4949
5050 def test_shareable(self):
51+ interp = interpreters.create()
5152 rch, sch = channels.create()
5253
5354 self.assertTrue(
@@ -60,8 +61,25 @@ def test_shareable(self):
6061 rch2 = rch.recv()
6162 sch2 = rch.recv()
6263
64+ interp.prepare_main(rch=rch, sch=sch)
65+ sch.send_nowait(rch)
66+ sch.send_nowait(sch)
67+ interp.exec(dedent("""
68+ rch2 = rch.recv()
69+ sch2 = rch.recv()
70+ assert rch2 == rch
71+ assert sch2 == sch
72+
73+ sch.send_nowait(rch2)
74+ sch.send_nowait(sch2)
75+ """))
76+ rch3 = rch.recv()
77+ sch3 = rch.recv()
78+
6379 self.assertEqual(rch2, rch)
6480 self.assertEqual(sch2, sch)
81+ self.assertEqual(rch3, rch)
82+ self.assertEqual(sch3, sch)
6583
6684 def test_is_closed(self):
6785 rch, sch = channels.create()
Original file line number Diff line number Diff line change @@ -2615,10 +2615,10 @@ _get_current_channelend_type(int end)
26152615 }
26162616 if (cls == NULL) {
26172617 // Force the module to be loaded, to register the type.
2618- PyObject *highlevel = PyImport_ImportModule("interpreters.channel ");
2618+ PyObject *highlevel = PyImport_ImportModule("interpreters.channels ");
26192619 if (highlevel == NULL) {
26202620 PyErr_Clear();
2621- highlevel = PyImport_ImportModule("test.support.interpreters.channel ");
2621+ highlevel = PyImport_ImportModule("test.support.interpreters.channels ");
26222622 if (highlevel == NULL) {
26232623 return NULL;
26242624 }
You can’t perform that action at this time.
0 commit comments