summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index c9882a7..600cc5e 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -778,7 +778,7 @@ PyState_RemoveModule(struct PyModuleDef* def)
return PyList_SetItem(interp->modules_by_index, index, Py_None);
}
-/* Used by PyImport_Cleanup() */
+// Used by finalize_modules()
void
_PyInterpreterState_ClearModules(PyInterpreterState *interp)
{
@@ -1920,11 +1920,17 @@ _PyInterpreterState_GetConfig(PyInterpreterState *interp)
}
-PyStatus
-_PyInterpreterState_SetConfig(PyInterpreterState *interp,
- const PyConfig *config)
+int
+_PyInterpreterState_GetConfigCopy(PyConfig *config)
{
- return _PyConfig_Copy(&interp->config, config);
+ PyInterpreterState *interp = PyInterpreterState_Get();
+
+ PyStatus status = _PyConfig_Copy(config, &interp->config);
+ if (PyStatus_Exception(status)) {
+ _PyErr_SetFromPyStatus(status);
+ return -1;
+ }
+ return 0;
}