summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-05-02 19:25:34 (GMT)
committerGitHub <noreply@github.com>2019-05-02 19:25:34 (GMT)
commit70005ac0fddd8585725b92acd1bc2b8e7b81999c (patch)
treef1be156bc866978bc4d251879f1e285cfa2df7ee /Include
parent709d23dee69e700b87d5a4cb59e149d0e1af7993 (diff)
downloadcpython-70005ac0fddd8585725b92acd1bc2b8e7b81999c.zip
cpython-70005ac0fddd8585725b92acd1bc2b8e7b81999c.tar.gz
cpython-70005ac0fddd8585725b92acd1bc2b8e7b81999c.tar.bz2
bpo-36763: _PyCoreConfig_SetPyArgv() preinitializes Python (GH-13037)
_PyCoreConfig_SetPyArgv() and _PyCoreConfig_SetWideString() now pre-initialize Python if needed to ensure that the locale encoding is properly configured. * Add _Py_PreInitializeFromPyArgv() internal function. * Add 'args' parameter to _Py_PreInitializeFromCoreConfig()
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_pylifecycle.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/Include/internal/pycore_pylifecycle.h b/Include/internal/pycore_pylifecycle.h
index 321cc5d..adb1f5d 100644
--- a/Include/internal/pycore_pylifecycle.h
+++ b/Include/internal/pycore_pylifecycle.h
@@ -8,7 +8,8 @@ extern "C" {
# error "this header requires Py_BUILD_CORE define"
#endif
-#include "pycore_pystate.h" /* _PyRuntimeState */
+#include "pycore_coreconfig.h" /* _PyArgv */
+#include "pycore_pystate.h" /* _PyRuntimeState */
/* True if the main interpreter thread exited due to an unhandled
* KeyboardInterrupt exception, suggesting the user pressed ^C. */
@@ -90,8 +91,12 @@ extern void _PyGILState_Fini(_PyRuntimeState *runtime);
PyAPI_FUNC(void) _PyGC_DumpShutdownStats(_PyRuntimeState *runtime);
+PyAPI_FUNC(_PyInitError) _Py_PreInitializeFromPyArgv(
+ const _PyPreConfig *src_config,
+ const _PyArgv *args);
PyAPI_FUNC(_PyInitError) _Py_PreInitializeFromCoreConfig(
- const _PyCoreConfig *coreconfig);
+ const _PyCoreConfig *coreconfig,
+ const _PyArgv *args);
#ifdef __cplusplus
}