mirror of
https://github.com/m-labs/artiq.git
synced 2025-01-09 18:43:34 +08:00
asyncio: Use ProactorEventLoop on Windows
This commit is contained in:
parent
0ff84c6534
commit
272c01f9a3
@ -3,6 +3,7 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import argparse
|
import argparse
|
||||||
import atexit
|
import atexit
|
||||||
|
import os
|
||||||
|
|
||||||
from artiq.protocols.pc_rpc import Server
|
from artiq.protocols.pc_rpc import Server
|
||||||
from artiq.protocols.sync_struct import Publisher
|
from artiq.protocols.sync_struct import Publisher
|
||||||
@ -40,7 +41,11 @@ def main():
|
|||||||
repository = Repository()
|
repository = Repository()
|
||||||
explist = FlatFileDB("explist.pyon")
|
explist = FlatFileDB("explist.pyon")
|
||||||
|
|
||||||
loop = asyncio.get_event_loop()
|
if os.name == 'nt':
|
||||||
|
loop = asyncio.ProactorEventLoop()
|
||||||
|
asyncio.set_event_loop(loop)
|
||||||
|
else:
|
||||||
|
loop = asyncio.get_event_loop()
|
||||||
atexit.register(lambda: loop.close())
|
atexit.register(lambda: loop.close())
|
||||||
|
|
||||||
def run_cb(rid, run_params):
|
def run_cb(rid, run_params):
|
||||||
|
Loading…
Reference in New Issue
Block a user