mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-124058: remove _PyCompile_IsNestedScope, roll it into _PyCompile_IsInteractive (#124061)
This commit is contained in:
parent
453da532fe
commit
9aa1f60e2d
3 changed files with 6 additions and 13 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue