diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2023-01-10 19:33:41 +0530 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2023-01-10 18:08:47 +0000 |
commit | cec2dd2ecfd12ac6383a3cf6e0982109af8f6faf (patch) | |
tree | 318655debe82a4dbb879ef494822d3fc78ead763 | |
parent | 7aa0baf4d6d46cb28c53b1e957a353cc0e7d5b92 (diff) |
cerbero: Fix python 3.6 compat (regression)
The heartbeat is purely cosmetic anyway.
Fixes https://gitlab.freedesktop.org/gstreamer/cerbero/-/issues/400
Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/1069>
-rw-r--r-- | cerbero/build/oven.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/cerbero/build/oven.py b/cerbero/build/oven.py index 5f3155a4..75f9b72a 100644 --- a/cerbero/build/oven.py +++ b/cerbero/build/oven.py @@ -398,18 +398,20 @@ class Oven (object): tasks.append(asyncio.ensure_future(cook_recipe_worker(default_queue, set(all_steps) - set(used_steps)))) async def recipes_done(): - async def heartbeat_output(): - while True: - await asyncio.sleep(60) - self._build_status_printer.heartbeat() + if hasattr(asyncio, 'create_task'): + async def heartbeat_output(): + while True: + await asyncio.sleep(60) + self._build_status_printer.heartbeat() - heartbeat_task = asyncio.create_task(heartbeat_output()) + heartbeat_task = asyncio.create_task(heartbeat_output()) while built_recipes & recipe_targets != recipe_targets: for q in queues.values(): await q.join() - heartbeat_task.cancel() + if hasattr(asyncio, 'create_task'): + heartbeat_task.cancel() # push the initial set of recipes that have no dependencies to start |