summaryrefslogtreecommitdiffstats
path: root/Modules/_xxsubinterpretersmodule.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-05-15 22:08:09 (GMT)
committerGitHub <noreply@github.com>2018-05-15 22:08:09 (GMT)
commitd8dcd57edb88ce57063e5c2b85fe0ee1abb1ce8b (patch)
tree5ec713e229d1899681cc32a5a91512d9b04c002d /Modules/_xxsubinterpretersmodule.c
parent038b21f2caaed0f02fee524277cc61e2c6ae0e9a (diff)
downloadcpython-d8dcd57edb88ce57063e5c2b85fe0ee1abb1ce8b.zip
cpython-d8dcd57edb88ce57063e5c2b85fe0ee1abb1ce8b.tar.gz
cpython-d8dcd57edb88ce57063e5c2b85fe0ee1abb1ce8b.tar.bz2
bpo-33454: Fix arguments parsing in _xxsubinterpreters.channel_close(). (GH-6747)
Diffstat (limited to 'Modules/_xxsubinterpretersmodule.c')
-rw-r--r--Modules/_xxsubinterpretersmodule.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c
index 634823a..f5e2ea3 100644
--- a/Modules/_xxsubinterpretersmodule.c
+++ b/Modules/_xxsubinterpretersmodule.c
@@ -2470,12 +2470,8 @@ PyDoc_STRVAR(channel_recv_doc,
Return a new object from the data at the from of the channel's queue.");
static PyObject *
-channel_close(PyObject *self, PyObject *args, PyObject *kwds)
+channel_close(PyObject *self, PyObject *id)
{
- PyObject *id;
- if (!PyArg_UnpackTuple(args, "channel_recv", 1, 1, &id)) {
- return NULL;
- }
int64_t cid = _coerce_id(id);
if (cid < 0) {
return NULL;
@@ -2570,8 +2566,8 @@ static PyMethodDef module_functions[] = {
METH_VARARGS, channel_send_doc},
{"channel_recv", (PyCFunction)channel_recv,
METH_VARARGS, channel_recv_doc},
- {"channel_close", (PyCFunction)channel_close,
- METH_VARARGS, channel_close_doc},
+ {"channel_close", channel_close,
+ METH_O, channel_close_doc},
{"channel_drop_interpreter", (PyCFunction)channel_drop_interpreter,
METH_VARARGS | METH_KEYWORDS, channel_drop_interpreter_doc},
{"_channel_id", (PyCFunction)channel__channel_id,