summaryrefslogtreecommitdiffstats
path: root/Lib/test/badsyntax_async2.py
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-07-22 10:33:45 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2015-07-22 10:33:45 (GMT)
commit8fb307cd650511ba019c4493275cb6684ad308bc (patch)
treedc1138644436a3e2c0592f096c6b8d0e47aec5ef /Lib/test/badsyntax_async2.py
parent80acc3ebbc4c81f9c1bff864eca076d6bdbe9ec6 (diff)
downloadcpython-8fb307cd650511ba019c4493275cb6684ad308bc.zip
cpython-8fb307cd650511ba019c4493275cb6684ad308bc.tar.gz
cpython-8fb307cd650511ba019c4493275cb6684ad308bc.tar.bz2
Issue #24619: New approach for tokenizing async/await.
This commit fixes how one-line async-defs and defs are tracked by tokenizer. It allows to correctly parse invalid code such as: >>> async def f(): ... def g(): pass ... async = 10 and valid code such as: >>> async def f(): ... async def g(): pass ... await z As a consequence, is is now possible to have one-line 'async def foo(): await ..' functions: >>> async def foo(): return await bar()
Diffstat (limited to 'Lib/test/badsyntax_async2.py')
-rw-r--r--Lib/test/badsyntax_async2.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/test/badsyntax_async2.py b/Lib/test/badsyntax_async2.py
index 1e62a3e..6f6f4f5 100644
--- a/Lib/test/badsyntax_async2.py
+++ b/Lib/test/badsyntax_async2.py
@@ -1,3 +1,2 @@
-async def foo():
- def foo(a:await something()):
- pass
+async def foo(a:await something()):
+ pass