summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2019-03-15 23:47:43 (GMT)
committerGitHub <noreply@github.com>2019-03-15 23:47:43 (GMT)
commitd2fdd1fedf6b9dc785cf5025b548a989faed089a (patch)
treefad1d8a72d9dea315758219cd5f1122ba0d0a87a /Include
parentc11183cdcff6af13c4339fdcce84ab63f7930ddc (diff)
downloadcpython-d2fdd1fedf6b9dc785cf5025b548a989faed089a.zip
cpython-d2fdd1fedf6b9dc785cf5025b548a989faed089a.tar.gz
cpython-d2fdd1fedf6b9dc785cf5025b548a989faed089a.tar.bz2
bpo-36124: Add PyInterpreterState.dict. (gh-12132)
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_pystate.h2
-rw-r--r--Include/pystate.h10
2 files changed, 10 insertions, 2 deletions
diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h
index 945d992..703a85b 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 a79a2e6..4c25e3f 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*);