summaryrefslogtreecommitdiffstats
path: root/Programs
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-03-15 14:08:05 (GMT)
committerGitHub <noreply@github.com>2019-03-15 14:08:05 (GMT)
commit74f6568bbd3e70806ea3219e8bacb386ad802ccf (patch)
tree98516f3e71020f12109372492180a835307e129f /Programs
parent86082c22d23285995a32aabb491527c9f5629556 (diff)
downloadcpython-74f6568bbd3e70806ea3219e8bacb386ad802ccf.zip
cpython-74f6568bbd3e70806ea3219e8bacb386ad802ccf.tar.gz
cpython-74f6568bbd3e70806ea3219e8bacb386ad802ccf.tar.bz2
bpo-36301: Add _PyWstrList structure (GH-12343)
Replace messy _Py_wstrlist_xxx() functions with a new clean _PyWstrList structure and new _PyWstrList_xxx() functions. Changes: * Add _PyCoreConfig.use_module_search_paths to decide if _PyCoreConfig.module_search_paths should be computed or not, to support empty search path list. * _PyWstrList_Clear() sets length to 0 and items to NULL, whereas _Py_wstrlist_clear() only freed memory. * _PyWstrList_Append() returns an int, whereas _Py_wstrlist_append() returned _PyInitError. * _PyWstrList uses Py_ssize_t for the length, instead of int. * Replace (int, wchar_t**) with _PyWstrList in: * _PyPreConfig * _PyCoreConfig * _PyPreCmdline * _PyCmdline * Replace "int orig_argv; wchar_t **orig_argv;" with "_PyWstrList orig_argv". * _PyCmdline and _PyPreCmdline now also copy wchar_argv. * Rename _PyArgv_Decode() to _PyArgv_AsWstrList(). * PySys_SetArgvEx() now pass the fixed (argc, argv) to _PyPathConfig_ComputeArgv0() (don't pass negative argc or NULL argv). * _PyOS_GetOpt() uses Py_ssize_t
Diffstat (limited to 'Programs')
-rw-r--r--Programs/_testembed.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Programs/_testembed.c b/Programs/_testembed.c
index bba2510..7c143f1 100644
--- a/Programs/_testembed.c
+++ b/Programs/_testembed.c
@@ -479,8 +479,8 @@ static int test_init_from_config(void)
L"-c",
L"pass",
};
- config.argc = Py_ARRAY_LENGTH(argv);
- config.argv = argv;
+ config.argv.length = Py_ARRAY_LENGTH(argv);
+ config.argv.items = argv;
config.program = L"conf_program";
@@ -489,15 +489,15 @@ static int test_init_from_config(void)
L"core_xoption2=",
L"core_xoption3",
};
- config.nxoption = Py_ARRAY_LENGTH(xoptions);
- config.xoptions = xoptions;
+ config.xoptions.length = Py_ARRAY_LENGTH(xoptions);
+ config.xoptions.items = xoptions;
static wchar_t* warnoptions[2] = {
L"default",
L"error::ResourceWarning",
};
- config.nwarnoption = Py_ARRAY_LENGTH(warnoptions);
- config.warnoptions = warnoptions;
+ config.warnoptions.length = Py_ARRAY_LENGTH(warnoptions);
+ config.warnoptions.items = warnoptions;
/* FIXME: test module_search_path_env */
/* FIXME: test home */