mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #26182: Raise DeprecationWarning for improper use of async/await keywords
This commit is contained in:
parent
6775231597
commit
8987c9d219
6 changed files with 125 additions and 56 deletions
|
@ -1345,18 +1345,6 @@ class GrammarTests(unittest.TestCase):
|
|||
self.assertEqual(m.other, 42)
|
||||
|
||||
def test_async_await(self):
|
||||
async = 1
|
||||
await = 2
|
||||
self.assertEqual(async, 1)
|
||||
|
||||
def async():
|
||||
nonlocal await
|
||||
await = 10
|
||||
async()
|
||||
self.assertEqual(await, 10)
|
||||
|
||||
self.assertFalse(bool(async.__code__.co_flags & inspect.CO_COROUTINE))
|
||||
|
||||
async def test():
|
||||
def sum():
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue