summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-06-11 16:40:15 (GMT)
committerGitHub <noreply@github.com>2024-06-11 16:40:15 (GMT)
commit2dd07fd899da50a0f25f0d586b8615a05b462244 (patch)
tree4b3c22ae8ce614bcfd9b6f2a7abda09637165bf7 /Modules
parent64a61ca13c221bf6a2cba4704e1d822b2c36af27 (diff)
downloadcpython-2dd07fd899da50a0f25f0d586b8615a05b462244.zip
cpython-2dd07fd899da50a0f25f0d586b8615a05b462244.tar.gz
cpython-2dd07fd899da50a0f25f0d586b8615a05b462244.tar.bz2
[3.13] gh-120346: Respect PYTHON_BASIC_REPL when running in interactive inspect mode (GH-120349) (#120351)
(cherry picked from commit ec3af291fe2f680ab277edde7113e2762754f4aa) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Diffstat (limited to 'Modules')
-rw-r--r--Modules/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/main.c b/Modules/main.c
index 8eded26..1a70b30 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -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);