strengthen condition and add assertion
diff --git a/Python/compile.c b/Python/compile.c
index 85ea1d0..9176e31 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -670,7 +670,8 @@
         return NULL;
 
     stack_size = PyList_GET_SIZE(c->c_stack);
-    global_scope = stack_size <= 1;
+    assert(stack_size >= 1);
+    global_scope = stack_size == 1;
     if (scope_name != NULL && !global_scope) {
         int scope;
         PyObject *mangled;