Skip to content
Merged
Show file tree
Hide file tree
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
Move _PyXI_GET_STATE() to the API.
  • Loading branch information
ericsnowcurrently committed Nov 11, 2024
commit 45ace429a2e85a081a455c10fea83ce059fc4cbc
5 changes: 3 additions & 2 deletions Include/internal/pycore_crossinterp.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,14 @@ typedef struct {
} exceptions;
} _PyXI_state_t;

#define _PyXI_GET_GLOBAL_STATE(interp) (&(interp)->runtime->xi)
#define _PyXI_GET_STATE(interp) (&(interp)->xi)

extern PyStatus _PyXI_Init(PyInterpreterState *interp);
extern void _PyXI_Fini(PyInterpreterState *interp);
extern PyStatus _PyXI_InitTypes(PyInterpreterState *interp);
extern void _PyXI_FiniTypes(PyInterpreterState *interp);

#define _PyInterpreterState_GetXIState(interp) (&(interp)->xi)


/***************************/
/* short-term data sharing */
Expand Down
2 changes: 1 addition & 1 deletion Modules/_interpretersmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ module_exec(PyObject *mod)
goto error;
}
PyObject *PyExc_NotShareableError = \
_PyInterpreterState_GetXIState(interp)->exceptions.PyExc_NotShareableError;
_PyXI_GET_STATE(interp)->exceptions.PyExc_NotShareableError;
if (PyModule_AddType(mod, (PyTypeObject *)PyExc_NotShareableError) < 0) {
goto error;
}
Expand Down
4 changes: 0 additions & 4 deletions Python/crossinterp.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
#include "pycore_pyerrors.h" // _PyErr_Clear()


#define _PyXI_GET_GLOBAL_STATE(interp) (&(interp)->runtime->xi)
#define _PyXI_GET_STATE(interp) (&(interp)->xi)


/**************/
/* exceptions */
/**************/
Expand Down