bpo-45773: Stop "optimizing" certain jump patterns (GH-29505)

This commit is contained in:
Brandt Bucher 2021-11-11 11:44:34 -08:00 committed by GitHub
parent 9178f533ff
commit 27b69e60da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 49 additions and 76 deletions

View file

@ -600,5 +600,12 @@ class TestBuglets(unittest.TestCase):
except Exception or Exception:
pass
def test_bpo_45773_pop_jump_if_true(self):
compile("while True or spam: pass", "<test>", "exec")
def test_bpo_45773_pop_jump_if_false(self):
compile("while True or not spam: pass", "<test>", "exec")
if __name__ == "__main__":
unittest.main()