diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-11-05 18:07:34 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-11-05 18:07:34 +0100 |
commit | 76ff36c05f434947e1b90490d682b3282646cbfd (patch) | |
tree | 9beab0c63ab912ecac780cb51859366f2ae800b9 /Python/compile.c | |
parent | 04790f7d371ea56a10f49123210d42fee5f9c06b (diff) | |
download | cpython-76ff36c05f434947e1b90490d682b3282646cbfd.tar.gz |
Issue #19437: Fix compiler_class(), handle compiler_lookup_arg() failure
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c index 32465f7169..8b00211c9f 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1772,6 +1772,10 @@ compiler_class(struct compiler *c, stmt_ty s) } 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); |