Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[3.13] gh-120346: Respect PYTHON_BASIC_REPL when running in interactive inspect mode (GH-120349) #120351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Respect :envvar:`PYTHON_BASIC_REPL` when running in interative inspect mode
(``python -i``). Patch by Pablo Galindo
3 changes: 2 additions & 1 deletion Modules/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading