mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
asyncio: Support PEP 492. Issue #24017.
This commit is contained in:
parent
d7e19bb566
commit
1af2bf75a2
6 changed files with 116 additions and 27 deletions
|
@ -1638,7 +1638,7 @@ class TaskTests(test_utils.TestCase):
|
|||
return a
|
||||
|
||||
def call(arg):
|
||||
cw = asyncio.coroutines.CoroWrapper(foo(), foo)
|
||||
cw = asyncio.coroutines.CoroWrapper(foo())
|
||||
cw.send(None)
|
||||
try:
|
||||
cw.send(arg)
|
||||
|
@ -1653,7 +1653,7 @@ class TaskTests(test_utils.TestCase):
|
|||
def test_corowrapper_weakref(self):
|
||||
wd = weakref.WeakValueDictionary()
|
||||
def foo(): yield from []
|
||||
cw = asyncio.coroutines.CoroWrapper(foo(), foo)
|
||||
cw = asyncio.coroutines.CoroWrapper(foo())
|
||||
wd['cw'] = cw # Would fail without __weakref__ slot.
|
||||
cw.gen = None # Suppress warning from __del__.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue