summaryrefslogtreecommitdiffstats
path: root/Modules/main.c
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 /Modules/main.c
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 'Modules/main.c')
-rw-r--r--Modules/main.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/Modules/main.c b/Modules/main.c
index 575683c..e117ef2 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -57,14 +57,7 @@ pymain_init(const _PyArgv *args)
environment variables (PYTHONUTF8 and PYTHONCOERCECLOCALE) */
preconfig.coerce_c_locale = -1;
preconfig.utf8_mode = -1;
- if (args->use_bytes_argv) {
- err = _Py_PreInitializeFromArgs(&preconfig,
- args->argc, args->bytes_argv);
- }
- else {
- err = _Py_PreInitializeFromWideArgs(&preconfig,
- args->argc, args->wchar_argv);
- }
+ err = _Py_PreInitializeFromPyArgv(&preconfig, args);
if (_Py_INIT_FAILED(err)) {
return err;
}