diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2015-07-22 10:33:45 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-07-22 10:33:45 (GMT) |
commit | 8fb307cd650511ba019c4493275cb6684ad308bc (patch) | |
tree | dc1138644436a3e2c0592f096c6b8d0e47aec5ef /Lib/test/test_grammar.py | |
parent | 80acc3ebbc4c81f9c1bff864eca076d6bdbe9ec6 (diff) | |
download | cpython-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/test_grammar.py')
-rw-r--r-- | Lib/test/test_grammar.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index 2af7390..ca6b5d0 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -1051,10 +1051,7 @@ class GrammarTests(unittest.TestCase): async def test(): def sum(): - async = 1 - await = 41 - return async + await - + pass if 1: await someobj() |