Skip to content

Commit

Permalink
stop using explicit ProactorEventLoop on Windows
Browse files Browse the repository at this point in the history
It is now the default in Python.
  • Loading branch information
sbourdeauducq committed Dec 14, 2021
1 parent 352317d commit 9e5e234
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
7 changes: 1 addition & 6 deletions artiq/frontend/artiq_master.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import asyncio
import argparse
import atexit
import os
import logging

from sipyco.pc_rpc import Server as RPCServer
Expand Down Expand Up @@ -75,11 +74,7 @@ def get_name(self):
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)

Expand Down
6 changes: 1 addition & 5 deletions artiq/test/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import logging
import asyncio
import sys
import os
from time import time, sleep

from artiq.experiment import *
Expand Down Expand Up @@ -87,10 +86,7 @@ def get(self):

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):
Expand Down
6 changes: 1 addition & 5 deletions artiq/test/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import logging
import asyncio
import sys
import os
from time import sleep

from artiq.experiment import *
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 9e5e234

Please sign in to comment.