summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorge Zapata <jorgeluis.zapata@gmail.com>2019-04-08 11:57:52 +0200
committerJorge Zapata <jorgeluis.zapata@gmail.com>2019-04-08 11:57:52 +0200
commitee3d6611681d4f13994fb39904a72597ab34192a (patch)
tree83495aebc55a58a33120da562b3b1bb66ce4914b
parent27c3b2f53a4461a589173bd24627f95b79a11758 (diff)
Convert check to async functions
-rw-r--r--cerbero/commands/check.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/cerbero/commands/check.py b/cerbero/commands/check.py
index dd1013a2..12e33708 100644
--- a/cerbero/commands/check.py
+++ b/cerbero/commands/check.py
@@ -16,6 +16,7 @@
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
+import asyncio
from cerbero.commands import Command, register_command
from cerbero.build.cookbook import CookBook
@@ -62,7 +63,11 @@ class Check(Command):
if stepfunc:
try:
- stepfunc()
+ if asyncio.iscoroutinefunction(stepfunc):
+ loop = asyncio.get_event_loop()
+ loop.run_until_complete(stepfunc(recipe))
+ else:
+ stepfunc()
except FatalError as e:
raise e
except Exception as ex: