From 57ebe1b27d6ae10584d3b5f767e3cc5aa481c0b0 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 6 May 2015 16:46:21 +0100 Subject: [PATCH] unix-cpy: Fix adjustment of stack size when leaving exception handler. Also remove __debug__ from one of the bytecode tests. --- py/emitcpy.c | 2 +- tests/bytecode/pylib-tests/compileall.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/py/emitcpy.c b/py/emitcpy.c index 48c293091c..dc96c529fb 100644 --- a/py/emitcpy.c +++ b/py/emitcpy.c @@ -782,7 +782,7 @@ STATIC void emit_cpy_start_except_handler(emit_t *emit) { } STATIC void emit_cpy_end_except_handler(emit_t *emit) { - emit_cpy_adjust_stack_size(emit, -5); // stack adjust + emit_cpy_adjust_stack_size(emit, -2); // stack adjust } STATIC void emit_cpy_load_const_verbatim_strn(emit_t *emit, const char *str, mp_uint_t len) { diff --git a/tests/bytecode/pylib-tests/compileall.py b/tests/bytecode/pylib-tests/compileall.py index d3cff6a98a..d92a322cf6 100644 --- a/tests/bytecode/pylib-tests/compileall.py +++ b/tests/bytecode/pylib-tests/compileall.py @@ -88,7 +88,7 @@ def compile_file(fullname, ddir=None, force=False, rx=None, quiet=False, return success if os.path.isfile(fullname): if legacy: - cfile = fullname + ('c' if __debug__ else 'o') + cfile = fullname + 'c' else: if optimize >= 0: cfile = imp.cache_from_source(fullname,