extmod/uasyncio: Fix syntax of generator functions.

The compiler is not picky right now, but these are actually all syntax
errors:
- await is only valid in an async function
- async functions that use yield are actually async generators (a construct
  not supported by the compiler right now)
This commit is contained in:
Damien Tournoud
2022-12-13 08:22:11 -08:00
committed by Damien George
parent b75b5c102c
commit 0eba00a92c
4 changed files with 21 additions and 11 deletions

View File

@@ -28,7 +28,8 @@ class Lock:
# No Task waiting so unlock
self.state = 0
async def acquire(self):
# async
def acquire(self):
if self.state != 0:
# Lock unavailable, put the calling Task on the waiting queue
self.waiting.push(core.cur_task)