summaryrefslogtreecommitdiffstats
path: root/Modules/main.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-08-01 00:57:45 (GMT)
committerGitHub <noreply@github.com>2018-08-01 00:57:45 (GMT)
commita4d20b2e5ece2120f129cb4dda951a6c2461e92d (patch)
tree3286b602154f666d3a9edd3ce76619ccc053f05b /Modules/main.c
parentb75d7e243512afcfb2285e6471262478383e09db (diff)
downloadcpython-a4d20b2e5ece2120f129cb4dda951a6c2461e92d.zip
cpython-a4d20b2e5ece2120f129cb4dda951a6c2461e92d.tar.gz
cpython-a4d20b2e5ece2120f129cb4dda951a6c2461e92d.tar.bz2
bpo-34170: Py_Main() updates config when setting Py_InspectFlag (GH-8593)
Diffstat (limited to 'Modules/main.c')
-rw-r--r--Modules/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/main.c b/Modules/main.c
index 88e8262..f0b811b 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -1588,6 +1588,7 @@ pymain_run_filename(_PyMain *pymain, _PyCoreConfig *config,
{
if (pymain->filename == NULL && pymain->stdin_is_interactive) {
Py_InspectFlag = 0; /* do exit on SystemExit */
+ config->inspect = 0;
pymain_run_startup(pymain, config, cf);
pymain_run_interactive_hook();
}
@@ -1614,6 +1615,7 @@ pymain_repl(_PyMain *pymain, _PyCoreConfig *config, PyCompilerFlags *cf)
opportunity to set it from Python. */
if (!Py_InspectFlag && config_get_env_var(config, "PYTHONINSPECT")) {
Py_InspectFlag = 1;
+ config->inspect = 1;
}
if (!(Py_InspectFlag && pymain->stdin_is_interactive && RUN_CODE(pymain))) {
@@ -1621,6 +1623,7 @@ pymain_repl(_PyMain *pymain, _PyCoreConfig *config, PyCompilerFlags *cf)
}
Py_InspectFlag = 0;
+ config->inspect = 0;
pymain_run_interactive_hook();
int res = PyRun_AnyFileFlags(stdin, "<stdin>", cf);