Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d6dc7bd

Browse files
committed
Issue #23456: Add missing @coroutine decorators in asyncio
1 parent d55436a commit d6dc7bd

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

Lib/asyncio/base_subprocess.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ def _process_exited(self, returncode):
211211
waiter.set_result(returncode)
212212
self._exit_waiters = None
213213

214+
@coroutine
214215
def _wait(self):
215216
"""Wait until the process exit and return the process return code.
216217

Lib/asyncio/locks.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def __exit__(self, *args):
162162
# always raises; that's how the with-statement works.
163163
pass
164164

165+
@coroutine
165166
def __iter__(self):
166167
# This is not a coroutine. It is meant to enable the idiom:
167168
#
@@ -362,6 +363,7 @@ def __enter__(self):
362363
def __exit__(self, *args):
363364
pass
364365

366+
@coroutine
365367
def __iter__(self):
366368
# See comment in Lock.__iter__().
367369
yield from self.acquire()
@@ -446,6 +448,7 @@ def __enter__(self):
446448
def __exit__(self, *args):
447449
pass
448450

451+
@coroutine
449452
def __iter__(self):
450453
# See comment in Lock.__iter__().
451454
yield from self.acquire()

Lib/asyncio/streams.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ def feed_data(self, data):
378378
else:
379379
self._paused = True
380380

381+
@coroutine
381382
def _wait_for_data(self, func_name):
382383
"""Wait until feed_data() or feed_eof() is called."""
383384
# StreamReader uses a future to link the protocol feed_data() method

0 commit comments

Comments
 (0)