Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix Merge conflict
  • Loading branch information
nanjekyejoannah committed Mar 6, 2020
commit 2e608fb4f032ab34a41b7e31966d576625a42225
10 changes: 0 additions & 10 deletions Lib/test/test_interpreters.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,6 @@ class TestSendRecv(TestBase):

def test_fields(self):
r, s = interpreters.create_channel()
self.assertGreaterEqual(r.id, 0)
self.assertEqual([], r.interpreters)

def test_send_recv_main(self):
Expand Down Expand Up @@ -685,15 +684,6 @@ def test_with_unused_items(self):
with self.assertRaises(interpreters.ChannelClosedError):
r.recv()

def test_never_used(self):
r, s = interpreters.create_channel()
s.release()

with self.assertRaises(interpreters.ChannelClosedError):
s.send(b'spam')
with self.assertRaises(interpreters.ChannelClosedError):
r.recv()

class TestSendBuffer(TestBase):
def test_send_recv_main(self):
r, s = interpreters.create_channel()
Expand Down
13 changes: 4 additions & 9 deletions Modules/_xxsubinterpretersmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1570,14 +1570,13 @@ channel_id_converter(PyObject *arg, void *ptr)
else {
PyErr_Format(PyExc_TypeError,
"channel ID must be an int, got %.100s",
arg->ob_type->tp_name);
Py_TYPE(arg)->tp_name);
return 0;
}
*(int64_t *)ptr = cid;
return 1;
}


static channelid *
newchannelid(PyTypeObject *cls, int64_t cid, int end, _channels *channels,
int force, int resolve)
Expand Down Expand Up @@ -2553,14 +2552,10 @@ static PyObject *
channel_send_buffer(PyObject *self, PyObject *args, PyObject *kwds)
{
static char *kwlist[] = {"cid", "obj", NULL};
PyObject *id;
int64_t cid;
PyObject *obj;
if (!PyArg_ParseTupleAndKeywords(args, kwds,
"OO:channel_send_buffer", kwlist, &id, &obj)) {
return NULL;
}
int64_t cid = _Py_CoerceID(id);
if (cid < 0) {
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O:channel_send", kwlist,
channel_id_converter, &cid, &obj)) {
return NULL;
}

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.