Content-Length: 294240 | pFad | http://github.com/python/cpython/pull/6914/commits/828a227ded9f06853bfa94599b545a15d1d3db53

79 bpo-32604: Improve subinterpreter tests. by ericsnowcurrently · Pull Request #6914 · python/cpython · GitHub
Skip to content

bpo-32604: Improve subinterpreter tests. #6914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
May 16, 2018
Merged
Changes from 1 commit
Commits
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
Next Next commit
Convert channel IDs into channels when shared.
  • Loading branch information
ericsnowcurrently committed May 16, 2018
commit 828a227ded9f06853bfa94599b545a15d1d3db53
34 changes: 32 additions & 2 deletions Modules/_xxsubinterpretersmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1525,8 +1525,38 @@ static PyObject *
_channelid_from_xid(_PyCrossInterpreterData *data)
{
struct _channelid_xid *xid = (struct _channelid_xid *)data->data;
return (PyObject *)newchannelid(&ChannelIDtype, xid->id, xid->end,
_global_channels(), 0);
PyObject *cid = (PyObject *)newchannelid(&ChannelIDtype, xid->id, xid->end,
_global_channels(), 0);
if (xid->end == 0) {
return cid;
}

/* Try returning a high-level channel end but fall back to the ID. */
PyObject *highlevel = PyImport_ImportModule("interpreters");
if (highlevel == NULL) {
PyErr_Clear();
highlevel = PyImport_ImportModule("test.support.interpreters");
if (highlevel == NULL) {
goto error;
}
}
const char *clsname = (xid->end == CHANNEL_RECV) ? "RecvChannel" :
"SendChannel";
PyObject *cls = PyObject_GetAttrString(highlevel, clsname);
Py_DECREF(highlevel);
if (cls == NULL) {
goto error;
}
PyObject *chan = PyObject_CallFunctionObjArgs(cls, cid, NULL);
if (chan == NULL) {
goto error;
}
Py_DECREF(cid);
return chan;

error:
PyErr_Clear();
return cid;
}

static int
Expand Down








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/python/cpython/pull/6914/commits/828a227ded9f06853bfa94599b545a15d1d3db53

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy