Bug in "async for" indentation

This commit is contained in:
rocky
2020-02-06 23:54:03 -05:00
parent 6525ade805
commit 7fb50918cd
6 changed files with 11 additions and 8 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,3 +1,12 @@
async def a(b, c):
async for b in c:
pass
# From 3.7 test_generators.py
# Bug was getting indentation correct for multiple async's
async def foo(X):
async for i in X:
pass
async for i in X:
pass
raise Done

View File

@@ -56,7 +56,7 @@ def customize_for_version36(self, version):
"unpack_list": ("*%c", (0, "list")),
"tryfinally_return_stmt": ("%|try:\n%+%c%-%|finally:\n%+%|return%-\n\n", 1),
"async_for_stmt36": (
"%|async for %c in %c:\n%+%c%-%-\n\n",
"%|async for %c in %c:\n%+%c%-\n\n",
(9, "store"),
(1, "expr"),
(18, "for_block"),

View File

@@ -55,14 +55,8 @@ def customize_for_version37(self, version):
(1, "expr"),
(17, "for_block"),
),
"async_for_stmt36": (
"%|async for %c in %c:\n%+%c%-%-\n\n",
(9, "store"),
(1, "expr"),
(18, "for_block"),
),
"async_for_stmt37": (
"%|async for %c in %c:\n%+%c%-%-\n\n",
"%|async for %c in %c:\n%+%c%-\n\n",
(7, "store"),
(1, "expr"),
(16, "for_block"),