From 93c448506a187c36efce577ac2527237302101e8 Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 29 Jan 2021 14:55:05 +0100 Subject: basetabs: wrap coroutine commands in ensure_future --- poezio/tabs/basetabs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py index 5e9ba498..8f746eab 100644 --- a/poezio/tabs/basetabs.py +++ b/poezio/tabs/basetabs.py @@ -324,7 +324,10 @@ class Tab: if func: if hasattr(self.input, "reset_completion"): self.input.reset_completion() - func(arg) + if asyncio.iscoroutinefunction(func): + asyncio.ensure_future(func(arg)) + else: + func(arg) return True else: return False -- cgit v1.2.3