Lines Matching refs:config
346 static void config_set_string(PyConfig *config, wchar_t **config_str, const wchar_t *str) in config_set_string() argument
348 PyStatus status = PyConfig_SetString(config, config_str, str); in config_set_string()
350 PyConfig_Clear(config); in config_set_string()
356 static void config_set_argv(PyConfig *config, Py_ssize_t argc, wchar_t * const *argv) in config_set_argv() argument
358 PyStatus status = PyConfig_SetArgv(config, argc, argv); in config_set_argv()
360 PyConfig_Clear(config); in config_set_argv()
367 config_set_wide_string_list(PyConfig *config, PyWideStringList *list, in config_set_wide_string_list() argument
370 PyStatus status = PyConfig_SetWideStringList(config, list, length, items); in config_set_wide_string_list()
372 PyConfig_Clear(config); in config_set_wide_string_list()
378 static void config_set_program_name(PyConfig *config) in config_set_program_name() argument
381 config_set_string(config, &config->program_name, program_name); in config_set_program_name()
385 static void init_from_config_clear(PyConfig *config) in init_from_config_clear() argument
387 PyStatus status = Py_InitializeFromConfig(config); in init_from_config_clear()
388 PyConfig_Clear(config); in init_from_config_clear()
409 PyConfig config; in check_init_compat_config() local
410 _PyConfig_InitCompatConfig(&config); in check_init_compat_config()
412 config_set_program_name(&config); in check_init_compat_config()
413 init_from_config_clear(&config); in check_init_compat_config()
499 PyConfig config; in test_init_from_config() local
500 _PyConfig_InitCompatConfig(&config); in test_init_from_config()
502 config.install_signal_handlers = 0; in test_init_from_config()
507 config.use_hash_seed = 1; in test_init_from_config()
508 config.hash_seed = 123; in test_init_from_config()
513 config.faulthandler = 1; in test_init_from_config()
516 config.tracemalloc = 2; in test_init_from_config()
519 config.import_time = 1; in test_init_from_config()
521 config.show_ref_count = 1; in test_init_from_config()
525 config.malloc_stats = 1; in test_init_from_config()
528 config_set_string(&config, &config.pycache_prefix, L"conf_pycache_prefix"); in test_init_from_config()
531 config_set_string(&config, &config.program_name, L"./conf_program_name"); in test_init_from_config()
543 config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv); in test_init_from_config()
544 config.parse_argv = 1; in test_init_from_config()
551 config_set_wide_string_list(&config, &config.xoptions, in test_init_from_config()
557 config_set_wide_string_list(&config, &config.warnoptions, in test_init_from_config()
565 status = PyConfig_SetBytesString(&config, &config.platlibdir, "my_platlibdir"); in test_init_from_config()
567 PyConfig_Clear(&config); in test_init_from_config()
573 config.verbose = 1; in test_init_from_config()
576 config.site_import = 0; in test_init_from_config()
579 config.bytes_warning = 1; in test_init_from_config()
583 config.inspect = 1; in test_init_from_config()
586 config.interactive = 1; in test_init_from_config()
590 config.optimization_level = 2; in test_init_from_config()
596 config.write_bytecode = 0; in test_init_from_config()
599 config.quiet = 1; in test_init_from_config()
601 config.configure_c_stdio = 1; in test_init_from_config()
605 config.buffered_stdio = 0; in test_init_from_config()
612 config.legacy_windows_stdio = 0; in test_init_from_config()
614 config_set_string(&config, &config.stdio_encoding, L"iso8859-1"); in test_init_from_config()
615 config_set_string(&config, &config.stdio_errors, L"replace"); in test_init_from_config()
619 config.user_site_directory = 0; in test_init_from_config()
621 config_set_string(&config, &config.check_hash_pycs_mode, L"always"); in test_init_from_config()
624 config.pathconfig_warnings = 0; in test_init_from_config()
626 config._isolated_interpreter = 1; in test_init_from_config()
628 init_from_config_clear(&config); in test_init_from_config()
638 PyConfig config; in check_init_parse_argv() local
639 PyConfig_InitPythonConfig(&config); in check_init_parse_argv()
641 config.parse_argv = parse_argv; in check_init_parse_argv()
652 config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv); in check_init_parse_argv()
653 init_from_config_clear(&config); in check_init_parse_argv()
719 PyConfig config; in test_init_python_env() local
720 PyConfig_InitPythonConfig(&config); in test_init_python_env()
722 config_set_program_name(&config); in test_init_python_env()
723 init_from_config_clear(&config); in test_init_python_env()
767 PyConfig config; in test_init_isolated_flag() local
768 PyConfig_InitPythonConfig(&config); in test_init_isolated_flag()
771 config.isolated = 1; in test_init_isolated_flag()
773 config_set_program_name(&config); in test_init_isolated_flag()
775 init_from_config_clear(&config); in test_init_isolated_flag()
796 PyConfig config; in test_preinit_isolated1() local
797 _PyConfig_InitCompatConfig(&config); in test_preinit_isolated1()
799 config_set_program_name(&config); in test_preinit_isolated1()
801 init_from_config_clear(&config); in test_preinit_isolated1()
823 PyConfig config; in test_preinit_isolated2() local
824 _PyConfig_InitCompatConfig(&config); in test_preinit_isolated2()
827 config.isolated = 1; in test_preinit_isolated2()
829 config_set_program_name(&config); in test_preinit_isolated2()
831 init_from_config_clear(&config); in test_preinit_isolated2()
859 PyConfig config; in test_preinit_dont_parse_argv() local
860 PyConfig_InitIsolatedConfig(&config); in test_preinit_dont_parse_argv()
862 config.isolated = 0; in test_preinit_dont_parse_argv()
866 config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv); in test_preinit_dont_parse_argv()
867 config_set_program_name(&config); in test_preinit_dont_parse_argv()
868 init_from_config_clear(&config); in test_preinit_dont_parse_argv()
878 PyConfig config; in test_preinit_parse_argv() local
879 PyConfig_InitPythonConfig(&config); in test_preinit_parse_argv()
884 config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv); in test_preinit_parse_argv()
885 config_set_program_name(&config); in test_preinit_parse_argv()
886 init_from_config_clear(&config); in test_preinit_parse_argv()
943 PyConfig config; in check_preinit_isolated_config() local
944 PyConfig_InitIsolatedConfig(&config); in check_preinit_isolated_config()
946 config_set_program_name(&config); in check_preinit_isolated_config()
947 init_from_config_clear(&config); in check_preinit_isolated_config()
996 PyConfig config; in check_init_python_config() local
997 PyConfig_InitPythonConfig(&config); in check_init_python_config()
999 config_set_program_name(&config); in check_init_python_config()
1000 init_from_config_clear(&config); in check_init_python_config()
1034 PyConfig config; in test_init_dont_configure_locale() local
1035 PyConfig_InitPythonConfig(&config); in test_init_dont_configure_locale()
1037 config_set_program_name(&config); in test_init_dont_configure_locale()
1038 init_from_config_clear(&config); in test_init_dont_configure_locale()
1048 PyConfig config; in test_init_dev_mode() local
1049 PyConfig_InitPythonConfig(&config); in test_init_dev_mode()
1053 config.dev_mode = 1; in test_init_dev_mode()
1054 config_set_program_name(&config); in test_init_dev_mode()
1055 init_from_config_clear(&config); in test_init_dev_mode()
1276 PyConfig config; in run_audit_run_test() local
1277 PyConfig_InitPythonConfig(&config); in run_audit_run_test()
1279 config.argv.length = argc; in run_audit_run_test()
1280 config.argv.items = argv; in run_audit_run_test()
1281 config.parse_argv = 1; in run_audit_run_test()
1282 config.program_name = argv[0]; in run_audit_run_test()
1283 config.interactive = 1; in run_audit_run_test()
1284 config.isolated = 0; in run_audit_run_test()
1285 config.use_environment = 1; in run_audit_run_test()
1286 config.quiet = 1; in run_audit_run_test()
1290 PyStatus status = Py_InitializeFromConfig(&config); in run_audit_run_test()
1322 PyConfig config; in test_init_read_set() local
1323 PyConfig_InitPythonConfig(&config); in test_init_read_set()
1325 status = PyConfig_SetBytesString(&config, &config.program_name, in test_init_read_set()
1331 status = PyConfig_Read(&config); in test_init_read_set()
1336 status = PyWideStringList_Insert(&config.module_search_paths, in test_init_read_set()
1342 status = PyWideStringList_Append(&config.module_search_paths, in test_init_read_set()
1349 config_set_string(&config, &config.executable, L"my_executable"); in test_init_read_set()
1350 init_from_config_clear(&config); in test_init_read_set()
1357 PyConfig_Clear(&config); in test_init_read_set()
1368 PyConfig config; in test_init_sys_add() local
1369 PyConfig_InitPythonConfig(&config); in test_init_sys_add()
1378 config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv); in test_init_sys_add()
1379 config.parse_argv = 1; in test_init_sys_add()
1382 status = PyWideStringList_Append(&config.xoptions, in test_init_sys_add()
1388 status = PyWideStringList_Append(&config.warnoptions, in test_init_sys_add()
1394 config_set_program_name(&config); in test_init_sys_add()
1395 init_from_config_clear(&config); in test_init_sys_add()
1402 PyConfig_Clear(&config); in test_init_sys_add()
1456 PyConfig config; in test_init_setpath_config() local
1457 PyConfig_InitPythonConfig(&config); in test_init_setpath_config()
1459 config_set_string(&config, &config.program_name, L"conf_program_name"); in test_init_setpath_config()
1460 config_set_string(&config, &config.executable, L"conf_executable"); in test_init_setpath_config()
1461 init_from_config_clear(&config); in test_init_setpath_config()
1499 PyConfig config; in test_init_warnoptions() local
1500 PyConfig_InitPythonConfig(&config); in test_init_warnoptions()
1502 config.dev_mode = 1; in test_init_warnoptions()
1503 config.bytes_warning = 1; in test_init_warnoptions()
1505 config_set_program_name(&config); in test_init_warnoptions()
1508 status = PyWideStringList_Append(&config.warnoptions, in test_init_warnoptions()
1518 config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv); in test_init_warnoptions()
1519 config.parse_argv = 1; in test_init_warnoptions()
1521 status = PyConfig_Read(&config); in test_init_warnoptions()
1526 status = PyWideStringList_Append(&config.warnoptions, in test_init_warnoptions()
1532 status = PyWideStringList_Insert(&config.warnoptions, in test_init_warnoptions()
1538 init_from_config_clear(&config); in test_init_warnoptions()
1547 PyConfig config; in tune_config() local
1548 PyConfig_InitPythonConfig(&config); in tune_config()
1549 if (_PyInterpreterState_GetConfigCopy(&config) < 0) { in tune_config()
1550 PyConfig_Clear(&config); in tune_config()
1555 config.bytes_warning = 2; in tune_config()
1557 if (_PyInterpreterState_SetConfig(&config) < 0) { in tune_config()
1558 PyConfig_Clear(&config); in tune_config()
1561 PyConfig_Clear(&config); in tune_config()
1569 PyConfig config; in test_init_set_config() local
1570 PyConfig_InitIsolatedConfig(&config); in test_init_set_config()
1571 config_set_string(&config, &config.program_name, PROGRAM_NAME); in test_init_set_config()
1572 config._init_main = 0; in test_init_set_config()
1573 config.bytes_warning = 0; in test_init_set_config()
1574 init_from_config_clear(&config); in test_init_set_config()
1594 static void configure_init_main(PyConfig *config) in configure_init_main() argument
1602 config->parse_argv = 1; in configure_init_main()
1604 config_set_argv(config, Py_ARRAY_LENGTH(argv), argv); in configure_init_main()
1605 config_set_string(config, &config->program_name, L"./python3"); in configure_init_main()
1611 PyConfig config; in test_init_run_main() local
1612 PyConfig_InitPythonConfig(&config); in test_init_run_main()
1614 configure_init_main(&config); in test_init_run_main()
1615 init_from_config_clear(&config); in test_init_run_main()
1623 PyConfig config; in test_init_main() local
1624 PyConfig_InitPythonConfig(&config); in test_init_main()
1626 configure_init_main(&config); in test_init_main()
1627 config._init_main = 0; in test_init_main()
1628 init_from_config_clear(&config); in test_init_main()
1650 PyConfig config; in test_run_main() local
1651 PyConfig_InitPythonConfig(&config); in test_run_main()
1657 config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv); in test_run_main()
1658 config_set_string(&config, &config.program_name, L"./python3"); in test_run_main()
1659 init_from_config_clear(&config); in test_run_main()
1681 PyConfig config; in test_get_argc_argv() local
1682 PyConfig_InitPythonConfig(&config); in test_get_argc_argv()
1685 config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv); in test_get_argc_argv()
1686 config_set_string(&config, &config.program_name, L"./python3"); in test_get_argc_argv()
1690 PyStatus status = PyConfig_Read(&config); in test_get_argc_argv()
1692 PyConfig_Clear(&config); in test_get_argc_argv()
1696 init_from_config_clear(&config); in test_get_argc_argv()
1782 PyConfig config; in test_repeated_init_and_inittab() local
1783 PyConfig_InitPythonConfig(&config); in test_repeated_init_and_inittab()
1784 config.isolated = 1; in test_repeated_init_and_inittab()
1785 config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv); in test_repeated_init_and_inittab()
1786 init_from_config_clear(&config); in test_repeated_init_and_inittab()