mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Issue #23456: Add missing @coroutine decorators in asyncio
This commit is contained in:
parent
d55436ace3
commit
d6dc7bdaf9
3 changed files with 5 additions and 0 deletions
|
@ -162,6 +162,7 @@ class Lock:
|
|||
# always raises; that's how the with-statement works.
|
||||
pass
|
||||
|
||||
@coroutine
|
||||
def __iter__(self):
|
||||
# This is not a coroutine. It is meant to enable the idiom:
|
||||
#
|
||||
|
@ -362,6 +363,7 @@ class Condition:
|
|||
def __exit__(self, *args):
|
||||
pass
|
||||
|
||||
@coroutine
|
||||
def __iter__(self):
|
||||
# See comment in Lock.__iter__().
|
||||
yield from self.acquire()
|
||||
|
@ -446,6 +448,7 @@ class Semaphore:
|
|||
def __exit__(self, *args):
|
||||
pass
|
||||
|
||||
@coroutine
|
||||
def __iter__(self):
|
||||
# See comment in Lock.__iter__().
|
||||
yield from self.acquire()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue