mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
[3.13] gh-120346: Respect PYTHON_BASIC_REPL when running in interactive inspect mode (GH-120349) (#120351)
(cherry picked from commit ec3af291fe
)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
This commit is contained in:
parent
64a61ca13c
commit
2dd07fd899
2 changed files with 4 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
|||
Respect :envvar:`PYTHON_BASIC_REPL` when running in interative inspect mode
|
||||
(``python -i``). Patch by Pablo Galindo
|
|
@ -542,7 +542,8 @@ pymain_repl(PyConfig *config, int *exitcode)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!isatty(fileno(stdin))) {
|
||||
if (!isatty(fileno(stdin))
|
||||
|| _Py_GetEnv(config->use_environment, "PYTHON_BASIC_REPL")) {
|
||||
PyCompilerFlags cf = _PyCompilerFlags_INIT;
|
||||
int run = PyRun_AnyFileExFlags(stdin, "<stdin>", 0, &cf);
|
||||
*exitcode = (run != 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue