mirror of https://github.com/m-labs/artiq.git
asyncio: Use ProactorEventLoop on Windows
This commit is contained in:
parent
78fc5a8a71
commit
fc92a66e51
|
@ -3,6 +3,7 @@
|
|||
import asyncio
|
||||
import argparse
|
||||
import atexit
|
||||
import os
|
||||
|
||||
from artiq.protocols.pc_rpc import Server
|
||||
from artiq.protocols.sync_struct import Publisher
|
||||
|
@ -40,6 +41,10 @@ def main():
|
|||
repository = Repository()
|
||||
explist = FlatFileDB("explist.pyon")
|
||||
|
||||
if os.name == 'nt':
|
||||
loop = asyncio.ProactorEventLoop()
|
||||
asyncio.set_event_loop(loop)
|
||||
else:
|
||||
loop = asyncio.get_event_loop()
|
||||
atexit.register(lambda: loop.close())
|
||||
|
||||
|
|
Loading…
Reference in New Issue