@@ -389,6 +389,7 @@ typedef struct {
389389 /* non-zero is stdin is a TTY or if -i option is used */
390390 int stdin_is_interactive ;
391391 _PyCoreConfig core_config ;
392+ _PyMainInterpreterConfig config ;
392393 _Py_CommandLineDetails cmdline ;
393394 PyObject * main_importer_path ;
394395 /* non-zero if filename, command (-c) or module (-m) is set
@@ -409,6 +410,7 @@ typedef struct {
409410 {.status = 0, \
410411 .cf = {.cf_flags = 0}, \
411412 .core_config = _PyCoreConfig_INIT, \
413+ .config = _PyMainInterpreterConfig_INIT, \
412414 .main_importer_path = NULL, \
413415 .run_code = -1, \
414416 .program_name = NULL, \
@@ -442,7 +444,7 @@ pymain_free_impl(_PyMain *pymain)
442444 Py_CLEAR (pymain -> main_importer_path );
443445 PyMem_RawFree (pymain -> program_name );
444446
445- PyMem_RawFree (pymain -> core_config .module_search_path_env );
447+ PyMem_RawFree (pymain -> config .module_search_path_env );
446448
447449#ifdef __INSURE__
448450 /* Insure++ is a memory analysis tool that aids in discovering
@@ -957,20 +959,16 @@ pymain_get_program_name(_PyMain *pymain)
957959static int
958960pymain_init_main_interpreter (_PyMain * pymain )
959961{
960- _PyMainInterpreterConfig config = _PyMainInterpreterConfig_INIT ;
961962 _PyInitError err ;
962963
963- /* TODO: Moar config options! */
964- config .install_signal_handlers = 1 ;
965-
966964 /* TODO: Print any exceptions raised by these operations */
967- err = _Py_ReadMainInterpreterConfig (& config );
965+ err = _Py_ReadMainInterpreterConfig (& pymain -> config );
968966 if (_Py_INIT_FAILED (err )) {
969967 pymain -> err = err ;
970968 return -1 ;
971969 }
972970
973- err = _Py_InitializeMainInterpreter (& config );
971+ err = _Py_InitializeMainInterpreter (& pymain -> config );
974972 if (_Py_INIT_FAILED (err )) {
975973 pymain -> err = err ;
976974 return -1 ;
@@ -1387,7 +1385,7 @@ pymain_init_pythonpath(_PyMain *pymain)
13871385 return -1 ;
13881386 }
13891387
1390- pymain -> core_config .module_search_path_env = path2 ;
1388+ pymain -> config .module_search_path_env = path2 ;
13911389#else
13921390 char * path = pymain_get_env_var ("PYTHONPATH" );
13931391 if (!path ) {
@@ -1405,7 +1403,7 @@ pymain_init_pythonpath(_PyMain *pymain)
14051403 }
14061404 return -1 ;
14071405 }
1408- pymain -> core_config .module_search_path_env = wpath ;
1406+ pymain -> config .module_search_path_env = wpath ;
14091407#endif
14101408 return 0 ;
14111409}
@@ -1574,6 +1572,8 @@ pymain_init(_PyMain *pymain)
15741572 }
15751573
15761574 pymain -> core_config ._disable_importlib = 0 ;
1575+ /* TODO: Moar config options! */
1576+ pymain -> config .install_signal_handlers = 1 ;
15771577
15781578 orig_argc = pymain -> argc ; /* For Py_GetArgcArgv() */
15791579 orig_argv = pymain -> argv ;
0 commit comments