[3.10] bpo-45773: Stop "optimizing" certain jump patterns (GH-29526)
diff --git a/Lib/test/test_peepholer.py b/Lib/test/test_peepholer.py
index 4034154..11a4d17 100644
--- a/Lib/test/test_peepholer.py
+++ b/Lib/test/test_peepholer.py
@@ -514,5 +514,12 @@ def test_bpo_42057(self):
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()