mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
Revert "bpo-30406: Make async and await proper keywords (#1669)" (GH-6143)
This reverts commit ac317700ce
.
(Reverts only the lib2to3 part.)
This commit is contained in:
parent
fe2bbb1869
commit
f64aae46da
4 changed files with 94 additions and 20 deletions
|
@ -181,34 +181,34 @@ class TestAsyncAwait(GrammarTest):
|
|||
async def foo(): await x
|
||||
""")
|
||||
|
||||
self.validate("await x")
|
||||
self.validate("""def foo():
|
||||
await x""")
|
||||
self.invalid_syntax("await x")
|
||||
self.invalid_syntax("""def foo():
|
||||
await x""")
|
||||
|
||||
self.validate("""def foo():
|
||||
self.invalid_syntax("""def foo():
|
||||
def foo(): pass
|
||||
async def foo(): pass
|
||||
await x
|
||||
""")
|
||||
|
||||
def test_async_var(self):
|
||||
self.invalid_syntax("""async = 1""")
|
||||
self.invalid_syntax("""await = 1""")
|
||||
self.invalid_syntax("""def async(): pass""")
|
||||
self.validate("""async = 1""")
|
||||
self.validate("""await = 1""")
|
||||
self.validate("""def async(): pass""")
|
||||
|
||||
def test_async_with(self):
|
||||
self.validate("""async def foo():
|
||||
async for a in b: pass""")
|
||||
|
||||
self.validate("""def foo():
|
||||
async for a in b: pass""")
|
||||
self.invalid_syntax("""def foo():
|
||||
async for a in b: pass""")
|
||||
|
||||
def test_async_for(self):
|
||||
self.validate("""async def foo():
|
||||
async with a: pass""")
|
||||
|
||||
self.validate("""def foo():
|
||||
async with a: pass""")
|
||||
self.invalid_syntax("""def foo():
|
||||
async with a: pass""")
|
||||
|
||||
|
||||
class TestRaiseChanges(GrammarTest):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue