x = 2
"""), '<eval>', 'exec')
+ def test_try_except_in_while_with_chained_condition_compiles(self):
+ # see gh-124871
+ compile(textwrap.dedent("""
+ name_1, name_2, name_3 = 1, 2, 3
+ while name_3 <= name_2 > name_1:
+ try:
+ raise
+ except:
+ pass
+ finally:
+ pass
+ """), '<eval>', 'exec')
+
def test_compile_invalid_namedexpr(self):
# gh-109351
m = ast.Module(
basicblock **sp = stack;
entryblock->b_predecessors = 1;
*sp++ = entryblock;
+ entryblock->b_visited = 1;
while (sp > stack) {
basicblock *b = *(--sp);
- b->b_visited = 1;
if (b->b_next && BB_HAS_FALLTHROUGH(b)) {
if (!b->b_next->b_visited) {
assert(b->b_next->b_predecessors == 0);
*sp++ = b->b_next;
+ b->b_next->b_visited = 1;
}
b->b_next->b_predecessors++;
}
if (is_jump(instr) || is_block_push(instr)) {
target = instr->i_target;
if (!target->b_visited) {
- assert(target->b_predecessors == 0 || target == b->b_next);
*sp++ = target;
+ target->b_visited = 1;
}
target->b_predecessors++;
}