summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2024-09-16 13:58:18 (GMT)
committerGitHub <noreply@github.com>2024-09-16 13:58:18 (GMT)
commit9aa1f60e2dedd8a67c42fb4f4c56858b6ba5b947 (patch)
treea81811ff65734eba9708a05f8fc73e1e5228cb47 /Python/compile.c
parent453da532fee26dc4f83d4cab77eb9bdb17b941e6 (diff)
downloadcpython-9aa1f60e2dedd8a67c42fb4f4c56858b6ba5b947.zip
cpython-9aa1f60e2dedd8a67c42fb4f4c56858b6ba5b947.tar.gz
cpython-9aa1f60e2dedd8a67c42fb4f4c56858b6ba5b947.tar.bz2
gh-124058: remove _PyCompile_IsNestedScope, roll it into _PyCompile_IsInteractive (#124061)
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/Python/compile.c b/Python/compile.c
index e1d2c30..cdd4878 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1204,17 +1204,12 @@ _PyCompile_OptimizationLevel(compiler *c)
}
int
-_PyCompile_IsInteractive(compiler *c)
-{
- return c->c_interactive;
-}
-
-int
-_PyCompile_IsNestedScope(compiler *c)
+_PyCompile_IsInteractiveTopLevel(compiler *c)
{
assert(c->c_stack != NULL);
assert(PyList_CheckExact(c->c_stack));
- return PyList_GET_SIZE(c->c_stack) > 0;
+ bool is_nested_scope = PyList_GET_SIZE(c->c_stack) > 0;
+ return c->c_interactive && !is_nested_scope;
}
int