Commit d6dc7bda authored by Victor Stinner's avatar Victor Stinner

Issue #23456: Add missing @coroutine decorators in asyncio

parent d55436ac
...@@ -211,6 +211,7 @@ class BaseSubprocessTransport(transports.SubprocessTransport): ...@@ -211,6 +211,7 @@ class BaseSubprocessTransport(transports.SubprocessTransport):
waiter.set_result(returncode) waiter.set_result(returncode)
self._exit_waiters = None self._exit_waiters = None
@coroutine
def _wait(self): def _wait(self):
"""Wait until the process exit and return the process return code. """Wait until the process exit and return the process return code.
......
...@@ -162,6 +162,7 @@ class Lock: ...@@ -162,6 +162,7 @@ class Lock:
# always raises; that's how the with-statement works. # always raises; that's how the with-statement works.
pass pass
@coroutine
def __iter__(self): def __iter__(self):
# This is not a coroutine. It is meant to enable the idiom: # This is not a coroutine. It is meant to enable the idiom:
# #
...@@ -362,6 +363,7 @@ class Condition: ...@@ -362,6 +363,7 @@ class Condition:
def __exit__(self, *args): def __exit__(self, *args):
pass pass
@coroutine
def __iter__(self): def __iter__(self):
# See comment in Lock.__iter__(). # See comment in Lock.__iter__().
yield from self.acquire() yield from self.acquire()
...@@ -446,6 +448,7 @@ class Semaphore: ...@@ -446,6 +448,7 @@ class Semaphore:
def __exit__(self, *args): def __exit__(self, *args):
pass pass
@coroutine
def __iter__(self): def __iter__(self):
# See comment in Lock.__iter__(). # See comment in Lock.__iter__().
yield from self.acquire() yield from self.acquire()
......
...@@ -378,6 +378,7 @@ class StreamReader: ...@@ -378,6 +378,7 @@ class StreamReader:
else: else:
self._paused = True self._paused = True
@coroutine
def _wait_for_data(self, func_name): def _wait_for_data(self, func_name):
"""Wait until feed_data() or feed_eof() is called.""" """Wait until feed_data() or feed_eof() is called."""
# StreamReader uses a future to link the protocol feed_data() method # StreamReader uses a future to link the protocol feed_data() method
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment