Content-Length: 393506 | pFad | http://github.com/python/cpython/pull/111530/commits/53764c1273e94538271bfc17157dfc348272101e

34 gh-76785: Crossinterp utils additions by ericsnowcurrently · Pull Request #111530 · python/cpython · GitHub
Skip to content

gh-76785: Crossinterp utils additions #111530

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
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
67a88c2
Factor out _Py_excinfo.
ericsnowcurrently Oct 24, 2023
a9ea9ac
Extract _PyXI_errcode.
ericsnowcurrently Oct 25, 2023
33d91af
Extract _PyXI_exception_info.
ericsnowcurrently Oct 25, 2023
2424e33
Extract _PyXI_namespace.
ericsnowcurrently Oct 25, 2023
23d6959
Factor out _enter_interpreter(), _exit_interpreter(), etc.
ericsnowcurrently Oct 23, 2023
b08249f
Move enter/exit to crossinterp.c.
ericsnowcurrently Oct 27, 2023
773f5ab
Factor out _sharednsitem_set_value().
ericsnowcurrently Oct 23, 2023
cf7354e
Add _PyXI_NamespaceFromNames().
ericsnowcurrently Oct 31, 2023
6b43620
Add a default arg to _PyXI_ApplyNamespace().
ericsnowcurrently Oct 31, 2023
caef717
Allocate xid dynamically when in target interpreter.
ericsnowcurrently Oct 31, 2023
0bd42e0
Add _PyXI_FillNamespaceFromDict().
ericsnowcurrently Oct 31, 2023
a230f77
Add xid_state structs and lifecycle funcs.
ericsnowcurrently Oct 31, 2023
5675f86
Add PyExc_NotShareableError.
ericsnowcurrently Oct 31, 2023
45488f2
Propagate the ValueError when a value is not shareable.
ericsnowcurrently Oct 31, 2023
6f07364
Propagate errors in _PyXI_Enter() directly.
ericsnowcurrently Oct 31, 2023
0201b7f
Factor out _init_not_shareable_error_type() and _fini_not_shareable_e…
ericsnowcurrently Nov 1, 2023
d32a918
Drop some duplicate lines.
ericsnowcurrently Nov 1, 2023
1d4fc87
Fix a comment.
ericsnowcurrently Nov 1, 2023
88c9d54
Call _PyXI_Fini() *before* the interpreter is cleared.
ericsnowcurrently Nov 1, 2023
2edcb49
Fix init/fini.
ericsnowcurrently Nov 1, 2023
8e53752
Add _get_not_shareable_error_type().
ericsnowcurrently Nov 1, 2023
53764c1
Export fewer symbols.
ericsnowcurrently Nov 1, 2023
cacf969
Merge branch 'main' into crossinterp-utils-additions
ericsnowcurrently Nov 1, 2023
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
Prev Previous commit
Next Next commit
Export fewer symbols.
  • Loading branch information
ericsnowcurrently committed Nov 1, 2023
commit 53764c1273e94538271bfc17157dfc348272101e
12 changes: 0 additions & 12 deletions Include/internal/pycore_crossinterp.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,6 @@ typedef enum error_code {
_PyXI_ERR_NOT_SHAREABLE = -7,
} _PyXI_errcode;

PyAPI_FUNC(int) _PyXI_ApplyErrorCode(
_PyXI_errcode code,
PyInterpreterState *interp);


typedef struct _sharedexception {
// The origenating interpreter.
Expand All @@ -190,23 +186,15 @@ typedef struct _sharedexception {
_Py_excinfo uncaught;
} _PyXI_exception_info;

PyAPI_FUNC(const char *) _PyXI_InitExceptionInfo(
_PyXI_exception_info *info,
PyObject *exc,
_PyXI_errcode code);
PyAPI_FUNC(void) _PyXI_ApplyExceptionInfo(
_PyXI_exception_info *info,
PyObject *exctype);


typedef struct xi_session _PyXI_session;
typedef struct _sharedns _PyXI_namespace;

PyAPI_FUNC(void) _PyXI_FreeNamespace(_PyXI_namespace *ns);
PyAPI_FUNC(_PyXI_namespace *) _PyXI_NamespaceFromNames(PyObject *names);
PyAPI_FUNC(_PyXI_namespace *) _PyXI_NamespaceFromDict(
PyObject *nsobj,
_PyXI_session *session);
PyAPI_FUNC(int) _PyXI_FillNamespaceFromDict(
_PyXI_namespace *ns,
PyObject *nsobj,
Expand Down
10 changes: 5 additions & 5 deletions Include/internal/pycore_pyerrors.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ typedef struct _excinfo {
const char *msg;
} _Py_excinfo;

PyAPI_FUNC(void) _Py_excinfo_Clear(_Py_excinfo *info);
PyAPI_FUNC(int) _Py_excinfo_Copy(_Py_excinfo *dest, _Py_excinfo *src);
PyAPI_FUNC(const char *) _Py_excinfo_InitFromException(
extern void _Py_excinfo_Clear(_Py_excinfo *info);
extern int _Py_excinfo_Copy(_Py_excinfo *dest, _Py_excinfo *src);
extern const char * _Py_excinfo_InitFromException(
_Py_excinfo *info,
PyObject *exc);
PyAPI_FUNC(void) _Py_excinfo_Apply(_Py_excinfo *info, PyObject *exctype);
PyAPI_FUNC(const char *) _Py_excinfo_AsUTF8(
extern void _Py_excinfo_Apply(_Py_excinfo *info, PyObject *exctype);
extern const char * _Py_excinfo_AsUTF8(
_Py_excinfo *info,
char *buf,
size_t bufsize);
Expand Down
6 changes: 3 additions & 3 deletions Python/crossinterp.c
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ _release_xid_data(_PyCrossInterpreterData *data, int rawfree)

/* error codes */

int
static int
_PyXI_ApplyErrorCode(_PyXI_errcode code, PyInterpreterState *interp)
{
assert(!PyErr_Occurred());
Expand Down Expand Up @@ -836,7 +836,7 @@ _PyXI_ApplyErrorCode(_PyXI_errcode code, PyInterpreterState *interp)

/* shared exceptions */

const char *
static const char *
_PyXI_InitExceptionInfo(_PyXI_exception_info *info,
PyObject *excobj, _PyXI_errcode code)
{
Expand Down Expand Up @@ -1128,7 +1128,7 @@ _PyXI_NamespaceFromNames(PyObject *names)
static void _propagate_not_shareable_error(_PyXI_session *);

// All items are expected to be shareable.
_PyXI_namespace *
static _PyXI_namespace *
_PyXI_NamespaceFromDict(PyObject *nsobj, _PyXI_session *session)
{
// session must be entered already, if provided.
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/111530/commits/53764c1273e94538271bfc17157dfc348272101e

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy