Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a8a38b8

Browse files
committed
strengthen condition and add assertion
1 parent ebe83f9 commit a8a38b8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Python/compile.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,8 @@ compiler_scope_qualname(struct compiler *c, identifier scope_name)
670670
return NULL;
671671

672672
stack_size = PyList_GET_SIZE(c->c_stack);
673-
global_scope = stack_size <= 1;
673+
assert(stack_size >= 1);
674+
global_scope = stack_size == 1;
674675
if (scope_name != NULL && !global_scope) {
675676
int scope;
676677
PyObject *mangled;

0 commit comments

Comments
 (0)