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

Skip to content

Commit 403d6df

Browse files
pablogsalmrahtz
authored andcommitted
pythongh-120346: Respect PYTHON_BASIC_REPL when running in interactive inspect mode (python#120349)
1 parent 39ab1f0 commit 403d6df

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