Skip to content

Commit 711dd39

Browse files
committed
extmod/uasyncio: Don't create a Loop instance in get_event_loop().
The event loop is (for now) just a singleton so make it so that Loop instances are not needed.
1 parent 8fff0b0 commit 711dd39

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

extmod/uasyncio/core.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,20 +215,20 @@ def run(coro):
215215

216216

217217
class Loop:
218-
def create_task(self, coro):
218+
def create_task(coro):
219219
return create_task(coro)
220220

221-
def run_forever(self):
221+
def run_forever():
222222
run_until_complete()
223223
# TODO should keep running until .stop() is called, even if there're no tasks left
224224

225-
def run_until_complete(self, aw):
225+
def run_until_complete(aw):
226226
return run_until_complete(_promote_to_task(aw))
227227

228-
def close(self):
228+
def close():
229229
pass
230230

231231

232232
# The runq_len and waitq_len arguments are for legacy uasyncio compatibility
233233
def get_event_loop(runq_len=0, waitq_len=0):
234-
return Loop()
234+
return Loop

0 commit comments

Comments
 (0)