diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2015-03-18 10:37:54 (GMT) |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2015-03-18 10:37:54 (GMT) |
| commit | 50931f41d0837d309289ec36b80951d3c38b30d4 (patch) | |
| tree | 2a00d8c0b92c5236cd70cc32b0a163ca7e47a7ac /Lib/asyncio/locks.py | |
| parent | 7fea974baf7ba69824a511ddaf7776634ea0737a (diff) | |
| parent | d6dc7bdaf92915fa47caa47f35ca3cb4505f9f34 (diff) | |
| download | cpython-50931f41d0837d309289ec36b80951d3c38b30d4.zip cpython-50931f41d0837d309289ec36b80951d3c38b30d4.tar.gz cpython-50931f41d0837d309289ec36b80951d3c38b30d4.tar.bz2 | |
Merge 3.4 (asyncio)
Diffstat (limited to 'Lib/asyncio/locks.py')
| -rw-r--r-- | Lib/asyncio/locks.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/asyncio/locks.py b/Lib/asyncio/locks.py index b943e9d..41a68c6 100644 --- a/Lib/asyncio/locks.py +++ b/Lib/asyncio/locks.py @@ -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() |
