File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -576,12 +576,8 @@ pymain_repl(PyConfig *config, int *exitcode)
576576{
577577 /* Check this environment variable at the end, to give programs the
578578 opportunity to set it from Python. */
579- if (!config -> inspect ) {
580- int inspect_env = 0 ;
581- _Py_get_env_flag (config -> use_environment , & inspect_env , "PYTHONINSPECT" );
582- if (inspect_env ) {
583- pymain_set_inspect (config , 1 );
584- }
579+ if (!config -> inspect && _Py_GetEnv (config -> use_environment , "PYTHONINSPECT" )) {
580+ pymain_set_inspect (config , 1 );
585581 }
586582
587583 if (!(config -> inspect && stdin_is_interactive (config ) && config_run_code (config ))) {
Original file line number Diff line number Diff line change @@ -1846,7 +1846,9 @@ config_read_env_vars(PyConfig *config)
18461846 _Py_get_env_flag (use_env , & config -> parser_debug , "PYTHONDEBUG" );
18471847 _Py_get_env_flag (use_env , & config -> verbose , "PYTHONVERBOSE" );
18481848 _Py_get_env_flag (use_env , & config -> optimization_level , "PYTHONOPTIMIZE" );
1849- _Py_get_env_flag (use_env , & config -> inspect , "PYTHONINSPECT" );
1849+ if (_Py_GetEnv (use_env , "PYTHONINSPECT" )) {
1850+ config -> inspect = 1 ;
1851+ }
18501852
18511853 int dont_write_bytecode = 0 ;
18521854 _Py_get_env_flag (use_env , & dont_write_bytecode , "PYTHONDONTWRITEBYTECODE" );
You can’t perform that action at this time.
0 commit comments