[3.14] gh-143135: Fix sys.flags.inspect when PYTHONINSPECT=0 (GH-143136) (GH-143153)

(cherry picked from commit 3509fa5a12)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2025-12-24 19:23:41 +01:00 committed by GitHub
parent 6809811036
commit 73c40bb8ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -1845,7 +1845,9 @@ config_read_env_vars(PyConfig *config)
_Py_get_env_flag(use_env, &config->parser_debug, "PYTHONDEBUG");
_Py_get_env_flag(use_env, &config->verbose, "PYTHONVERBOSE");
_Py_get_env_flag(use_env, &config->optimization_level, "PYTHONOPTIMIZE");
_Py_get_env_flag(use_env, &config->inspect, "PYTHONINSPECT");
if (!config->inspect && _Py_GetEnv(use_env, "PYTHONINSPECT")) {
config->inspect = 1;
}
int dont_write_bytecode = 0;
_Py_get_env_flag(use_env, &dont_write_bytecode, "PYTHONDONTWRITEBYTECODE");