Kaydet (Commit) 80c4d9a5 authored tarafından Patrick Maupin's avatar Patrick Maupin

Fix if (yield) bug

üst 810c2c2c
......@@ -19,10 +19,10 @@ op_data = """
Assign 1
AugAssign 0
Expr 0
If 0
Yield 1
If 1
For 0
While 0
Yield 1
Return 1
Slice 1
......
......@@ -198,6 +198,12 @@ class CodegenTestCase(unittest.TestCase):
self.assertAstEqual(source)
source = "[(yield)]"
self.assertAstEqual(source)
source = "if (yield): pass"
self.assertAstEqual(source)
source = "if (yield from foo): pass"
self.assertAstEqualIfAtLeastVersion(source, (3, 3))
source = "(yield from (a, b))"
self.assertAstEqualIfAtLeastVersion(source, (3, 3))
def test_with(self):
source = """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment