gh-124058: remove _PyCompile_IsNestedScope, roll it into _PyCompile_IsInteractive (#124061)

This commit is contained in:
Irit Katriel 2024-09-16 14:58:18 +01:00 committed by GitHub
parent 453da532fe
commit 9aa1f60e2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 13 deletions

View file

@ -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