8000 gh-120346: Respect PYTHON_BASIC_REPL when running in interactive insp… · python/cpython@ec3af29 · GitHub
[go: up one dir, main page]

Skip to content

Commit ec3af29

Browse files
authored
gh-120346: Respect PYTHON_BASIC_REPL when running in interactive inspect mode (#120349)
1 parent 9b8611e commit ec3af29

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Respect :envvar:`PYTHON_BASIC_REPL` when running in interative inspect mode
2+
(``python -i``). Patch by Pablo Galindo

Modules/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,8 @@ pymain_repl(PyConfig *config, int *exitcode)
542542
return;
543543
}
544544

545-
if (!isatty(fileno(stdin))) {
545+
if (!isatty(fileno(stdin))
546+
|| _Py_GetEnv(config->use_environment, "PYTHON_BASIC_REPL")) {
546547
PyCompilerFlags cf = _PyCompilerFlags_INIT;
547548
int run = PyRun_AnyFileExFlags(stdin, "<stdin>", 0, &cf);
548549
*exitcode = (run != 0);

0 commit comments

Comments
 (0)
0