]> granicus.if.org Git - python/commitdiff
Issue #23456: Add missing @coroutine decorators in asyncio
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 18 Mar 2015 10:37:42 +0000 (11:37 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 18 Mar 2015 10:37:42 +0000 (11:37 +0100)
Lib/asyncio/base_subprocess.py
Lib/asyncio/locks.py
Lib/asyncio/streams.py

index d18f3e8f07c2ce5d4a752f00d791897baf4cf36b..c1477b8248db4ea87589658fdcf4c413582d408a 100644 (file)
@@ -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.
 
index b943e9dd4f9704f5661ec683824efa5c7cdd3d73..41a68c6c8e1d973ad389e0603f3b0715a038f387 100644 (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()
index 7ff16a488f9ef3f39e85a56ae24fcdf16cc73eea..64ff3d2edc4c5586fef3de5ca72b915bdcad87c2 100644 (file)
@@ -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