Constrain ifelsestmt on 2.6 more.

This commit is contained in:
rocky
2020-01-15 21:32:39 -05:00
parent 3fbe0b90e3
commit 0677ddc8fb
5 changed files with 49 additions and 11 deletions

View File

@@ -32,3 +32,21 @@ assert eval_print_amount(True, False, False, False, []) == 0
assert eval_print_amount(False, True, True, False, []) == 2
assert eval_print_amount(False, False, True, True, []) == 3
assert eval_print_amount(False, False, False, True, []) == 0
# Bug in 2.6 was in including the part at x = value
# at the end asa part of the "else"
def eval_directive(a):
if a:
value = 2
else:
try:
value = 3
except:
pass
x = value
return x
assert eval_directive(True) == 2
assert eval_directive(False) == 3