diff options
author | Damien George <damien.p.george@gmail.com> | 2020-03-30 12:10:43 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-04-01 23:56:31 +1100 |
commit | 711dd392d3800f9513c0a534cf8ecd9c3bfd27e0 (patch) | |
tree | a471c4b6a84309ef89aabd5e75e504f6e7d94654 | |
parent | 8fff0b0acd96c22a555665467d3cf0d87af917e9 (diff) | |
download | micropython-711dd392d3800f9513c0a534cf8ecd9c3bfd27e0.tar.gz micropython-711dd392d3800f9513c0a534cf8ecd9c3bfd27e0.zip |
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.
-rw-r--r-- | extmod/uasyncio/core.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/extmod/uasyncio/core.py b/extmod/uasyncio/core.py index 5d7191d7fd..4a8597a3f2 100644 --- a/extmod/uasyncio/core.py +++ b/extmod/uasyncio/core.py @@ -215,20 +215,20 @@ def run(coro): class Loop: - def create_task(self, coro): + def create_task(coro): return create_task(coro) - def run_forever(self): + def run_forever(): run_until_complete() # TODO should keep running until .stop() is called, even if there're no tasks left - def run_until_complete(self, aw): + def run_until_complete(aw): return run_until_complete(_promote_to_task(aw)) - def close(self): + def close(): pass # The runq_len and waitq_len arguments are for legacy uasyncio compatibility def get_event_loop(runq_len=0, waitq_len=0): - return Loop() + return Loop |