summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2013-10-19 20:14:39 (GMT)
committerBenjamin Peterson <benjamin@python.org>2013-10-19 20:14:39 (GMT)
commita8a38b8e4f6a4273cfda8480458447f91310edf6 (patch)
tree89884b1da7999ebfff72d6934d58b095aa35ef7e /Python/compile.c
parentebe83f9875a2e54bfadf62823f39be44118517aa (diff)
downloadcpython-a8a38b8e4f6a4273cfda8480458447f91310edf6.zip
cpython-a8a38b8e4f6a4273cfda8480458447f91310edf6.tar.gz
cpython-a8a38b8e4f6a4273cfda8480458447f91310edf6.tar.bz2
strengthen condition and add assertion
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c3
1 files changed, 2 insertions, 1 deletions
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 @@ 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;