Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 43102:981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
| author | Collin Winter <collinw@gmail.com> |
|---|---|
| date | Fri, 31 Aug 2007 00:04:24 +0000 |
| parents | 4e6b4ba60c3b |
| children | b06b191b7cfa |
line wrap: on
line diff
--- a/Python/compile.c Thu Aug 30 23:34:01 2007 +0000 +++ b/Python/compile.c Fri Aug 31 00:04:24 2007 +0000 @@ -2187,11 +2187,9 @@ ADDOP_O(c, LOAD_GLOBAL, assertion_error, names); if (s->v.Assert.msg) { VISIT(c, expr, s->v.Assert.msg); - ADDOP_I(c, RAISE_VARARGS, 2); + ADDOP_I(c, CALL_FUNCTION, 1); } - else { - ADDOP_I(c, RAISE_VARARGS, 1); - } + ADDOP_I(c, RAISE_VARARGS, 1); compiler_use_next_block(c, end); ADDOP(c, POP_TOP); return 1; @@ -2244,17 +2242,13 @@ return compiler_if(c, s); case Raise_kind: n = 0; - if (s->v.Raise.type) { - VISIT(c, expr, s->v.Raise.type); + if (s->v.Raise.exc) { + VISIT(c, expr, s->v.Raise.exc); n++; - if (s->v.Raise.inst) { - VISIT(c, expr, s->v.Raise.inst); - n++; - if (s->v.Raise.tback) { - VISIT(c, expr, s->v.Raise.tback); - n++; - } - } + if (s->v.Raise.cause) { + VISIT(c, expr, s->v.Raise.cause); + n++; + } } ADDOP_I(c, RAISE_VARARGS, n); break;
