Skip to content

Commit e96a12a

Browse files
committed
Change yield in Lock.acquire() to asyncio.sleep(0)
1 parent ebd5251 commit e96a12a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

asyncio/lock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ async def acquire(self):
6565
# Set calling task's data to the lock's queue so it can be removed if needed
6666
core.cur_task.data = self.waiting
6767
try:
68-
yield
68+
core.sleep(0)
6969
except core.CancelledError as er:
7070
if self.state == core.cur_task:
7171
# Cancelled while pending on resume, schedule next waiting Task

0 commit comments

Comments
 (0)