From 5fd0d0bbb609445cb72451e07edc9d073a345b47 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 28 Jul 2020 12:08:47 +0800 Subject: [PATCH] gui: work around quamash bug with python 3.8 --- artiq/frontend/artiq_browser.py | 4 ++++ artiq/frontend/artiq_dashboard.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/artiq/frontend/artiq_browser.py b/artiq/frontend/artiq_browser.py index 6d499e558..9e514fba0 100755 --- a/artiq/frontend/artiq_browser.py +++ b/artiq/frontend/artiq_browser.py @@ -5,6 +5,7 @@ import asyncio import atexit import os import logging +import sys from PyQt5 import QtCore, QtGui, QtWidgets from quamash import QEventLoop @@ -143,6 +144,9 @@ def main(): app = QtWidgets.QApplication(["ARTIQ Browser"]) loop = QEventLoop(app) asyncio.set_event_loop(loop) + # https://github.com/harvimt/quamash/issues/123 + if sys.version_info >= (3, 8): + asyncio.events._set_running_loop(loop) atexit.register(loop.close) datasets_sub = models.LocalModelManager(datasets.Model) diff --git a/artiq/frontend/artiq_dashboard.py b/artiq/frontend/artiq_dashboard.py index ba0b9fd05..ace7e4eb2 100755 --- a/artiq/frontend/artiq_dashboard.py +++ b/artiq/frontend/artiq_dashboard.py @@ -5,6 +5,7 @@ import asyncio import atexit import os import logging +import sys from PyQt5 import QtCore, QtGui, QtWidgets from quamash import QEventLoop @@ -104,6 +105,9 @@ def main(): app = QtWidgets.QApplication(["ARTIQ Dashboard"]) loop = QEventLoop(app) asyncio.set_event_loop(loop) + # https://github.com/harvimt/quamash/issues/123 + if sys.version_info >= (3, 8): + asyncio.events._set_running_loop(loop) atexit.register(loop.close) smgr = state.StateManager(args.db_file)