[Python-checkins] cpython: Issue #19437: Fix compiler_class(), handle compiler_lookup_arg() failure

victor.stinner python-checkins at python.org
Tue Nov 5 18:08:05 CET 2013


http://hg.python.org/cpython/rev/ea373a14f9e9
changeset:   86948:ea373a14f9e9
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Tue Nov 05 18:07:34 2013 +0100
summary:
  Issue #19437: Fix compiler_class(), handle compiler_lookup_arg() failure

files:
  Python/compile.c |  4 ++++
  1 files changed, 4 insertions(+), 0 deletions(-)


diff --git a/Python/compile.c b/Python/compile.c
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -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);

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list