File tree 2 files changed +20
-2
lines changed
Lib/test/test_interpreters
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):
48
48
self .assertEqual (after , created )
49
49
50
50
def test_shareable (self ):
51
+ interp = interpreters .create ()
51
52
rch , sch = channels .create ()
52
53
53
54
self .assertTrue (
@@ -60,8 +61,25 @@ def test_shareable(self):
60
61
rch2 = rch .recv ()
61
62
sch2 = rch .recv ()
62
63
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
+
63
79
self .assertEqual (rch2 , rch )
64
80
self .assertEqual (sch2 , sch )
81
+ self .assertEqual (rch3 , rch )
82
+ self .assertEqual (sch3 , sch )
65
83
66
84
def test_is_closed (self ):
67
85
rch , sch = channels .create ()
Original file line number Diff line number Diff line change @@ -2615,10 +2615,10 @@ _get_current_channelend_type(int end)
2615
2615
}
2616
2616
if (cls == NULL ) {
2617
2617
// Force the module to be loaded, to register the type.
2618
- PyObject * highlevel = PyImport_ImportModule ("interpreters.channel " );
2618
+ PyObject * highlevel = PyImport_ImportModule ("interpreters.channels " );
2619
2619
if (highlevel == NULL ) {
2620
2620
PyErr_Clear ();
2621
- highlevel = PyImport_ImportModule ("test.support.interpreters.channel " );
2621
+ highlevel = PyImport_ImportModule ("test.support.interpreters.channels " );
2622
2622
if (highlevel == NULL ) {
2623
2623
return NULL ;
2624
2624
}
You can’t perform that action at this time.
0 commit comments