diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2022-07-31 16:33:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-31 16:33:56 +0100 |
commit | aa37ffda29ac48fb2df5a7029ba2e626ecc45850 (patch) | |
tree | 748f6ebe2d1bcc3b34cf999b15c1618a9365597b /Programs/_testembed.c | |
parent | 50b2261bdac98303087287b24eef96abd45a82f9 (diff) | |
download | cpython-git-aa37ffda29ac48fb2df5a7029ba2e626ecc45850.tar.gz |
bpo-45445: Revert "bpo-45445: Fail if an invalid X-option is provided in the command line (GH-28823)" (#94745)
Diffstat (limited to 'Programs/_testembed.c')
-rw-r--r-- | Programs/_testembed.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Programs/_testembed.c b/Programs/_testembed.c index 6b43d53403..f84445690e 100644 --- a/Programs/_testembed.c +++ b/Programs/_testembed.c @@ -279,7 +279,7 @@ static int test_pre_initialization_sys_options(void) * relying on the caller to keep the passed in strings alive. */ const wchar_t *static_warnoption = L"once"; - const wchar_t *static_xoption = L"utf8=1"; + const wchar_t *static_xoption = L"also_not_an_option=2"; size_t warnoption_len = wcslen(static_warnoption); size_t xoption_len = wcslen(static_xoption); wchar_t *dynamic_once_warnoption = \ @@ -298,7 +298,7 @@ static int test_pre_initialization_sys_options(void) PySys_AddWarnOption(L"module"); PySys_AddWarnOption(L"default"); _Py_EMBED_PREINIT_CHECK("Checking PySys_AddXOption\n"); - PySys_AddXOption(L"dev=2"); + PySys_AddXOption(L"not_an_option=1"); PySys_AddXOption(dynamic_xoption); /* Delete the dynamic options early */ @@ -591,7 +591,7 @@ static int test_init_from_config(void) L"-W", L"cmdline_warnoption", L"-X", - L"dev", + L"cmdline_xoption", L"-c", L"pass", L"arg2", @@ -599,9 +599,10 @@ static int test_init_from_config(void) config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv); config.parse_argv = 1; - wchar_t* xoptions[2] = { - L"dev=3", - L"utf8", + wchar_t* xoptions[3] = { + L"config_xoption1=3", + L"config_xoption2=", + L"config_xoption3", }; config_set_wide_string_list(&config, &config.xoptions, Py_ARRAY_LENGTH(xoptions), xoptions); @@ -1425,6 +1426,7 @@ fail: static int test_init_sys_add(void) { + PySys_AddXOption(L"sysadd_xoption"); PySys_AddXOption(L"faulthandler"); PySys_AddWarnOption(L"ignore:::sysadd_warnoption"); @@ -1436,14 +1438,14 @@ static int test_init_sys_add(void) L"-W", L"ignore:::cmdline_warnoption", L"-X", - L"utf8", + L"cmdline_xoption", }; config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv); config.parse_argv = 1; PyStatus status; status = PyWideStringList_Append(&config.xoptions, - L"dev"); + L"config_xoption"); if (PyStatus_Exception(status)) { goto fail; } |