diff Python/compile.c @ 86948:ea373a14f9e9

Issue #19437: Fix compiler_class(), handle compiler_lookup_arg() failure
author Victor Stinner <victor.stinner@gmail.com>
date Tue, 05 Nov 2013 18:07:34 +0100
parents bb2affc1e317
children 68fd86a83ece
line wrap: on
line diff
--- a/Python/compile.c	Tue Nov 05 15:10:19 2013 +0100
+++ b/Python/compile.c	Tue Nov 05 18:07:34 2013 +0100
@@ -1772,6 +1772,10 @@
             }
             i = compiler_lookup_arg(c->u->u_cellvars, str);
             Py_DECREF(str);
+            if (i < 0) {
+                compiler_exit_scope(c);
+                return 0;
+            }
             assert(i == 0);
             /* Return the cell where to store __class__ */
             ADDOP_I(c, LOAD_CLOSURE, i);