diff options
| author | Eric Snow <ericsnowcurrently@gmail.com> | 2019-03-15 17:47:43 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-15 17:47:43 -0600 |
| commit | d2fdd1fedf6b9dc785cf5025b548a989faed089a (patch) | |
| tree | fad1d8a72d9dea315758219cd5f1122ba0d0a87a /Include | |
| parent | c11183cdcff6af13c4339fdcce84ab63f7930ddc (diff) | |
| download | cpython-git-d2fdd1fedf6b9dc785cf5025b548a989faed089a.tar.gz | |
bpo-36124: Add PyInterpreterState.dict. (gh-12132)
Diffstat (limited to 'Include')
| -rw-r--r-- | Include/internal/pycore_pystate.h | 2 | ||||
| -rw-r--r-- | Include/pystate.h | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h index 945d9923a8..703a85b96b 100644 --- a/Include/internal/pycore_pystate.h +++ b/Include/internal/pycore_pystate.h @@ -63,6 +63,8 @@ struct _is { int dlopenflags; #endif + PyObject *dict; /* Stores per-interpreter state */ + PyObject *builtins_copy; PyObject *import_func; /* Initialized to PyEval_EvalFrameDefault(). */ diff --git a/Include/pystate.h b/Include/pystate.h index a79a2e60e2..4c25e3f7ef 100644 --- a/Include/pystate.h +++ b/Include/pystate.h @@ -24,17 +24,23 @@ typedef struct _ts PyThreadState; /* struct _is is defined in internal/pycore_pystate.h */ typedef struct _is PyInterpreterState; -/* State unique per thread */ - PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_New(void); PyAPI_FUNC(void) PyInterpreterState_Clear(PyInterpreterState *); PyAPI_FUNC(void) PyInterpreterState_Delete(PyInterpreterState *); +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03080000 +/* New in 3.8 */ +PyAPI_FUNC(PyObject *) PyInterpreterState_GetDict(PyInterpreterState *); +#endif + #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000 /* New in 3.7 */ PyAPI_FUNC(int64_t) PyInterpreterState_GetID(PyInterpreterState *); #endif #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 + +/* State unique per thread */ + /* New in 3.3 */ PyAPI_FUNC(int) PyState_AddModule(PyObject*, struct PyModuleDef*); PyAPI_FUNC(int) PyState_RemoveModule(struct PyModuleDef*); |
