mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-132775: Fix Interpreter.call() __main__ Visibility (gh-135595)
As noted in the new tests, there are a few situations we must carefully accommodate for functions that get pickled during interp.call(). We do so by running the script from the main interpreter's __main__ module in a hidden module in the other interpreter. That hidden module is used as the function __globals__.
This commit is contained in:
parent
fba5dded6d
commit
269e19e0a7
4 changed files with 419 additions and 246 deletions
|
@ -601,6 +601,7 @@ _make_call(struct interp_call *call,
|
|||
unwrap_not_shareable(tstate, failure);
|
||||
return -1;
|
||||
}
|
||||
assert(!_PyErr_Occurred(tstate));
|
||||
|
||||
// Make the call.
|
||||
PyObject *resobj = PyObject_Call(func, args, kwargs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue