py: Make compiler not crash when default except is not last.

This commit is contained in:
Damien George 2015-01-13 23:33:16 +00:00
parent d6ed6702f7
commit c935d69f74
1 changed files with 1 additions and 0 deletions

View File

@ -1987,6 +1987,7 @@ STATIC void compile_try_except(compiler_t *comp, mp_parse_node_t pn_body, int n_
// this is a catch all exception handler
if (i + 1 != n_except) {
compile_syntax_error(comp, pn_excepts[i], "default 'except:' must be last");
compile_decrease_except_level(comp);
return;
}
} else {