summaryrefslogtreecommitdiff
path: root/py/compile.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-03-29 14:00:03 +0000
committerDamien George <damien.p.george@gmail.com>2014-03-29 14:00:03 +0000
commit21a07dc50f764b72e6cb1d109160b17545db70ba (patch)
tree2e61ff9a1d869ff75431a5858a7bafb5095e4789 /py/compile.c
parentb04be056fe7694cdfe2df4c5103546a39d4fd8b2 (diff)
parente7286ef2c7db77879178f45f6055d8af2fc68281 (diff)
Merge pull request #389 from pfalcon/with-statement
With statement implementation
Diffstat (limited to 'py/compile.c')
-rw-r--r--py/compile.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/py/compile.c b/py/compile.c
index 48c9c0882..0e33ca268 100644
--- a/py/compile.c
+++ b/py/compile.c
@@ -1798,6 +1798,7 @@ void compile_with_stmt_helper(compiler_t *comp, int n, mp_parse_node_t *nodes, m
EMIT_ARG(setup_with, l_end);
EMIT(pop_top);
}
+ compile_increase_except_level(comp);
// compile additional pre-bits and the body
compile_with_stmt_helper(comp, n - 1, nodes + 1, body);
// finish this with block
@@ -1805,6 +1806,7 @@ void compile_with_stmt_helper(compiler_t *comp, int n, mp_parse_node_t *nodes, m
EMIT_ARG(load_const_tok, MP_TOKEN_KW_NONE);
EMIT_ARG(label_assign, l_end);
EMIT(with_cleanup);
+ compile_decrease_except_level(comp);
EMIT(end_finally);
}
}