mirror of https://github.com/python/cpython
gh-120346: Respect PYTHON_BASIC_REPL when running in interactive inspect mode (#120349)
This commit is contained in:
parent
9b8611eeea
commit
ec3af291fe
|
@ -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…
Reference in New Issue