]> granicus.if.org Git - python/commitdiff
strengthen condition and add assertion
authorBenjamin Peterson <benjamin@python.org>
Sat, 19 Oct 2013 20:14:39 +0000 (16:14 -0400)
committerBenjamin Peterson <benjamin@python.org>
Sat, 19 Oct 2013 20:14:39 +0000 (16:14 -0400)
Python/compile.c

index 85ea1d098dce2fe0a59729696ac1235823400e47..9176e3131db76355bf4f9f98070e92640e28ed10 100644 (file)
@@ -670,7 +670,8 @@ compiler_scope_qualname(struct compiler *c, identifier scope_name)
         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;