summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-01-29 14:55:05 +0100
committerLink Mauve <linkmauve@linkmauve.fr>2021-02-03 15:22:09 +0100
commit93c448506a187c36efce577ac2527237302101e8 (patch)
treeb5e9a5e894c9773af9dd1fae57a9953bfe30fc27
parent695b2ee09a89634159584a8ab519adb363d82f4e (diff)
downloadpoezio-93c448506a187c36efce577ac2527237302101e8.tar.gz
poezio-93c448506a187c36efce577ac2527237302101e8.tar.bz2
poezio-93c448506a187c36efce577ac2527237302101e8.tar.xz
poezio-93c448506a187c36efce577ac2527237302101e8.zip
basetabs: wrap coroutine commands in ensure_future
-rw-r--r--poezio/tabs/basetabs.py5
1 files changed, 4 insertions, 1 deletions
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