mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-132775: Expand the Capability of Interpreter.call() (gh-133484)
It now supports most callables, full args, and return values.
This commit is contained in:
parent
eb145fabbd
commit
52deabefd0
10 changed files with 1259 additions and 303 deletions
|
@ -317,7 +317,9 @@ typedef enum error_code {
|
|||
_PyXI_ERR_ALREADY_RUNNING = -4,
|
||||
_PyXI_ERR_MAIN_NS_FAILURE = -5,
|
||||
_PyXI_ERR_APPLY_NS_FAILURE = -6,
|
||||
_PyXI_ERR_NOT_SHAREABLE = -7,
|
||||
_PyXI_ERR_PRESERVE_FAILURE = -7,
|
||||
_PyXI_ERR_EXC_PROPAGATION_FAILURE = -8,
|
||||
_PyXI_ERR_NOT_SHAREABLE = -9,
|
||||
} _PyXI_errcode;
|
||||
|
||||
|
||||
|
@ -350,16 +352,33 @@ typedef struct xi_session _PyXI_session;
|
|||
PyAPI_FUNC(_PyXI_session *) _PyXI_NewSession(void);
|
||||
PyAPI_FUNC(void) _PyXI_FreeSession(_PyXI_session *);
|
||||
|
||||
typedef struct {
|
||||
PyObject *preserved;
|
||||
PyObject *excinfo;
|
||||
_PyXI_errcode errcode;
|
||||
} _PyXI_session_result;
|
||||
PyAPI_FUNC(void) _PyXI_ClearResult(_PyXI_session_result *);
|
||||
|
||||
PyAPI_FUNC(int) _PyXI_Enter(
|
||||
_PyXI_session *session,
|
||||
PyInterpreterState *interp,
|
||||
PyObject *nsupdates);
|
||||
PyAPI_FUNC(void) _PyXI_Exit(_PyXI_session *session);
|
||||
PyObject *nsupdates,
|
||||
_PyXI_session_result *);
|
||||
PyAPI_FUNC(int) _PyXI_Exit(
|
||||
_PyXI_session *,
|
||||
_PyXI_errcode,
|
||||
_PyXI_session_result *);
|
||||
|
||||
PyAPI_FUNC(PyObject *) _PyXI_GetMainNamespace(_PyXI_session *);
|
||||
PyAPI_FUNC(PyObject *) _PyXI_GetMainNamespace(
|
||||
_PyXI_session *,
|
||||
_PyXI_errcode *);
|
||||
|
||||
PyAPI_FUNC(PyObject *) _PyXI_ApplyCapturedException(_PyXI_session *session);
|
||||
PyAPI_FUNC(int) _PyXI_HasCapturedException(_PyXI_session *session);
|
||||
PyAPI_FUNC(int) _PyXI_Preserve(
|
||||
_PyXI_session *,
|
||||
const char *,
|
||||
PyObject *,
|
||||
_PyXI_errcode *);
|
||||
PyAPI_FUNC(PyObject *) _PyXI_GetPreserved(_PyXI_session_result *, const char *);
|
||||
|
||||
|
||||
/*************/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue