gh-133485: Use interpreters.Interpreter in InterpreterPoolExecutor (gh-133957)

Most importantly, this resolves the issues with functions and types defined in __main__.
It also expands the number of supported objects and simplifies the implementation.
This commit is contained in:
Eric Snow
2025-06-18 17:57:14 -06:00
committed by GitHub
parent 15f2bac02c
commit 725da50520
5 changed files with 266 additions and 205 deletions

View File

@@ -674,7 +674,9 @@ _PyPickle_Loads(struct _unpickle_context *ctx, PyObject *pickled)
finally:
if (exc != NULL) {
sync_module_capture_exc(tstate, &ctx->main);
if (_PyErr_Occurred(tstate)) {
sync_module_capture_exc(tstate, &ctx->main);
}
// We restore the original exception.
// It might make sense to chain it (__context__).
_PyErr_SetRaisedException(tstate, exc);