summaryrefslogtreecommitdiff
path: root/poezio/tabs/basetabs.py
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2021-11-18 15:23:46 +0100
committermathieui <mathieui@mathieui.net>2021-12-11 19:16:33 +0100
commit79bbbdb3e633152cc95e77a550f2eb2cde4e6784 (patch)
tree090c32aa64837d48b5851fb56a84fa7ee76399c6 /poezio/tabs/basetabs.py
parent2c59fa067af90bc116953f2ae162f5da4c1b6002 (diff)
downloadpoezio-79bbbdb3e633152cc95e77a550f2eb2cde4e6784.tar.gz
poezio-79bbbdb3e633152cc95e77a550f2eb2cde4e6784.tar.bz2
poezio-79bbbdb3e633152cc95e77a550f2eb2cde4e6784.tar.xz
poezio-79bbbdb3e633152cc95e77a550f2eb2cde4e6784.zip
Replace asyncio.ensure_future() with asyncio.create_task()
The latter function got introduced in Python 3.7, which is conveniently our MSPV, so let’s use that.
Diffstat (limited to 'poezio/tabs/basetabs.py')
-rw-r--r--poezio/tabs/basetabs.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py
index 508465e3..c2d9e93e 100644
--- a/poezio/tabs/basetabs.py
+++ b/poezio/tabs/basetabs.py
@@ -351,7 +351,7 @@ class Tab:
if hasattr(self.input, "reset_completion"):
self.input.reset_completion()
if asyncio.iscoroutinefunction(func):
- asyncio.ensure_future(func(arg))
+ asyncio.create_task(func(arg))
else:
func(arg)
return True
@@ -979,7 +979,7 @@ class ChatTab(Tab):
def on_scroll_up(self):
if not self.query_status:
from poezio.log_loader import LogLoader
- asyncio.ensure_future(
+ asyncio.create_task(
LogLoader(logger, self, config.getbool('use_log')).scroll_requested()
)
return self.text_win.scroll_up(self.text_win.height - 1)
@@ -1036,10 +1036,10 @@ class OneToOneTab(ChatTab):
if mam_filler.result == 0:
self.handle_message(initial)
- asyncio.ensure_future(fallback_no_mam())
+ asyncio.create_task(fallback_no_mam())
elif use_log and initial:
self.handle_message(initial, display=False)
- asyncio.ensure_future(
+ asyncio.create_task(
LogLoader(logger, self, use_log).tab_open()
)