diff options
author | Jim Mussared <jim.mussared@gmail.com> | 2021-02-12 14:11:18 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2021-02-13 15:11:17 +1100 |
commit | 7ed99544e4cc1c09bd5abf9f54869c3122fa033b (patch) | |
tree | 768869bfd2e8950906a47d2a6d62d613e93ba60d /extmod/uasyncio/core.py | |
parent | d128999938d6b44f52f4d0c6e1f5169ab3c1e7a5 (diff) | |
download | micropython-7ed99544e4cc1c09bd5abf9f54869c3122fa033b.tar.gz micropython-7ed99544e4cc1c09bd5abf9f54869c3122fa033b.zip |
extmod/uasyncio: Add asyncio.current_task().
Matches CPython behavior.
Fixes #6686
Diffstat (limited to 'extmod/uasyncio/core.py')
-rw-r--r-- | extmod/uasyncio/core.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/extmod/uasyncio/core.py b/extmod/uasyncio/core.py index 6a84b0982c..d74763f6a6 100644 --- a/extmod/uasyncio/core.py +++ b/extmod/uasyncio/core.py @@ -264,6 +264,10 @@ def get_event_loop(runq_len=0, waitq_len=0): return Loop +def current_task(): + return cur_task + + def new_event_loop(): global _task_queue, _io_queue # TaskQueue of Task instances |