diff options
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 11 |
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 |