Issue #23456: Add missing @coroutine decorators in asyncio

This commit is contained in:
Victor Stinner 2015-03-18 11:37:42 +01:00
parent d55436ace3
commit d6dc7bdaf9
3 changed files with 5 additions and 0 deletions

View file

@ -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()