summaryrefslogtreecommitdiff
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-03-18 11:37:42 +0100
committerVictor Stinner <victor.stinner@gmail.com>2015-03-18 11:37:42 +0100
commitd6dc7bdaf92915fa47caa47f35ca3cb4505f9f34 (patch)
tree891cf4020d85da52ab5cfd4f55fb75e461fecc7b /Lib/asyncio
parentd55436ace3cb908e0f7a1f368a2cd8879175947d (diff)
downloadcpython-git-d6dc7bdaf92915fa47caa47f35ca3cb4505f9f34.tar.gz
Issue #23456: Add missing @coroutine decorators in asyncio
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/base_subprocess.py1
-rw-r--r--Lib/asyncio/locks.py3
-rw-r--r--Lib/asyncio/streams.py1
3 files changed, 5 insertions, 0 deletions
diff --git a/Lib/asyncio/base_subprocess.py b/Lib/asyncio/base_subprocess.py
index d18f3e8f07..c1477b8248 100644
--- a/Lib/asyncio/base_subprocess.py
+++ b/Lib/asyncio/base_subprocess.py
@@ -211,6 +211,7 @@ class BaseSubprocessTransport(transports.SubprocessTransport):
waiter.set_result(returncode)
self._exit_waiters = None
+ @coroutine
def _wait(self):
"""Wait until the process exit and return the process return code.
diff --git a/Lib/asyncio/locks.py b/Lib/asyncio/locks.py
index b943e9dd4f..41a68c6c8e 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()
diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py
index 7ff16a488f..64ff3d2edc 100644
--- a/Lib/asyncio/streams.py
+++ b/Lib/asyncio/streams.py
@@ -378,6 +378,7 @@ class StreamReader:
else:
self._paused = True
+ @coroutine
def _wait_for_data(self, func_name):
"""Wait until feed_data() or feed_eof() is called."""
# StreamReader uses a future to link the protocol feed_data() method