Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 40588:4bab65fcca8e
Some more changes related to the new except syntax and semantics,
by Collin Winter.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Wed, 10 Jan 2007 18:51:35 +0000 |
| parents | 6b18a095c2e7 |
| children | e9a6234b26af |
line wrap: on
line diff
--- a/Python/compile.c Wed Jan 10 16:19:56 2007 +0000 +++ b/Python/compile.c Wed Jan 10 18:51:35 2007 +0000 @@ -1956,16 +1956,13 @@ ADDOP(c, POP_TOP); if (handler->name) { basicblock *cleanup_end, *cleanup_body; - expr_context_ty orig_ctx; - - assert(handler->name->kind == Name_kind); cleanup_end = compiler_new_block(c); cleanup_body = compiler_new_block(c); if(!(cleanup_end || cleanup_body)) return 0; - VISIT(c, expr, handler->name); + compiler_nameop(c, handler->name, Store); ADDOP(c, POP_TOP); /* @@ -1998,14 +1995,10 @@ /* name = None */ ADDOP_O(c, LOAD_CONST, Py_None, consts); - orig_ctx = handler->name->v.Name.ctx; - handler->name->v.Name.ctx = Store; - VISIT(c, expr, handler->name); - - /* del name */ - handler->name->v.Name.ctx = Del; - VISIT(c, expr, handler->name); - handler->name->v.Name.ctx = orig_ctx; + compiler_nameop(c, handler->name, Store); + + /* del name */ + compiler_nameop(c, handler->name, Del); ADDOP(c, END_FINALLY); compiler_pop_fblock(c, FINALLY_END, cleanup_end);
