From 9e5e234af31a82d053bc6c1add9eedc8bcf1d99b Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 14 Dec 2021 20:06:38 +0800 Subject: [PATCH] stop using explicit ProactorEventLoop on Windows It is now the default in Python. --- artiq/frontend/artiq_master.py | 7 +------ artiq/test/test_scheduler.py | 6 +----- artiq/test/test_worker.py | 6 +----- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/artiq/frontend/artiq_master.py b/artiq/frontend/artiq_master.py index ef46fb9bb..83c6615ae 100755 --- a/artiq/frontend/artiq_master.py +++ b/artiq/frontend/artiq_master.py @@ -3,7 +3,6 @@ import asyncio import argparse import atexit -import os import logging from sipyco.pc_rpc import Server as RPCServer @@ -75,11 +74,7 @@ class MasterConfig: def main(): args = get_argparser().parse_args() log_forwarder = init_log(args) - if os.name == "nt": - loop = asyncio.ProactorEventLoop() - asyncio.set_event_loop(loop) - else: - loop = asyncio.get_event_loop() + loop = asyncio.get_event_loop() atexit.register(loop.close) bind = common_args.bind_address_from_args(args) diff --git a/artiq/test/test_scheduler.py b/artiq/test/test_scheduler.py index 5a8cdb6bc..984804fcf 100644 --- a/artiq/test/test_scheduler.py +++ b/artiq/test/test_scheduler.py @@ -2,7 +2,6 @@ import unittest import logging import asyncio import sys -import os from time import time, sleep from artiq.experiment import * @@ -87,10 +86,7 @@ class _RIDCounter: class SchedulerCase(unittest.TestCase): def setUp(self): - if os.name == "nt": - self.loop = asyncio.ProactorEventLoop() - else: - self.loop = asyncio.new_event_loop() + self.loop = asyncio.new_event_loop() asyncio.set_event_loop(self.loop) def test_steps(self): diff --git a/artiq/test/test_worker.py b/artiq/test/test_worker.py index 88e3ead82..c33daf430 100644 --- a/artiq/test/test_worker.py +++ b/artiq/test/test_worker.py @@ -2,7 +2,6 @@ import unittest import logging import asyncio import sys -import os from time import sleep from artiq.experiment import * @@ -77,10 +76,7 @@ def _run_experiment(class_name): class WorkerCase(unittest.TestCase): def setUp(self): - if os.name == "nt": - self.loop = asyncio.ProactorEventLoop() - else: - self.loop = asyncio.new_event_loop() + self.loop = asyncio.new_event_loop() asyncio.set_event_loop(self.loop) def test_simple_run(self):