diff --git a/Lib/test/test_peepholer.py b/Lib/test/test_peepholer.py index 5d00240e2595a8..b5f85bd5597342 100644 --- a/Lib/test/test_peepholer.py +++ b/Lib/test/test_peepholer.py @@ -421,6 +421,14 @@ def f(): return 0 self.assertEqual(f(), 1) + def test_if_with_if_expression(self): + # Check bpo-37289 + def f(x): + if (True if x else False): + return True + return False + self.assertTrue(f(True)) + class TestBuglets(unittest.TestCase):
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: