remove workaround_asyncio263

This commit is contained in:
Sebastien Bourdeauducq 2015-12-20 23:26:48 +08:00
parent a26ffc5bfb
commit 183e855229
5 changed files with 6 additions and 15 deletions

View File

@ -2,7 +2,7 @@ import asyncio
import logging import logging
from artiq.protocols.asyncio_server import AsyncioServer from artiq.protocols.asyncio_server import AsyncioServer
from artiq.tools import TaskObject, workaround_asyncio263 from artiq.tools import TaskObject
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -123,7 +123,6 @@ class LogForwarder(logging.Handler, TaskObject):
while True: while True:
message = await self._queue.get() + "\n" message = await self._queue.get() + "\n"
writer.write(message.encode()) writer.write(message.encode())
await workaround_asyncio263()
await writer.drain() await writer.drain()
except asyncio.CancelledError: except asyncio.CancelledError:
return return

View File

@ -16,7 +16,6 @@ from functools import partial
from artiq.protocols import pyon from artiq.protocols import pyon
from artiq.protocols.asyncio_server import AsyncioServer from artiq.protocols.asyncio_server import AsyncioServer
from artiq.tools import workaround_asyncio263
_init_string = b"ARTIQ sync_struct\n" _init_string = b"ARTIQ sync_struct\n"
@ -233,7 +232,6 @@ class Publisher(AsyncioServer):
line = await queue.get() line = await queue.get()
writer.write(line) writer.write(line)
# raise exception on connection error # raise exception on connection error
await workaround_asyncio263()
await writer.drain() await writer.drain()
finally: finally:
self._recipients[notifier_name].remove(queue) self._recipients[notifier_name].remove(queue)

View File

@ -19,7 +19,7 @@ from artiq.protocols import pyon
__all__ = ["artiq_dir", "parse_arguments", "elide", "short_format", "file_import", __all__ = ["artiq_dir", "parse_arguments", "elide", "short_format", "file_import",
"get_experiment", "verbosity_args", "simple_network_args", "init_logger", "get_experiment", "verbosity_args", "simple_network_args", "init_logger",
"atexit_register_coroutine", "exc_to_warning", "asyncio_wait_or_cancel", "atexit_register_coroutine", "exc_to_warning", "asyncio_wait_or_cancel",
"TaskObject", "Condition", "workaround_asyncio263", "get_windows_drives"] "TaskObject", "Condition", "get_windows_drives"]
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -195,12 +195,6 @@ class Condition:
fut.set_result(False) fut.set_result(False)
# See: https://github.com/python/asyncio/issues/263
@asyncio.coroutine
def workaround_asyncio263():
yield
def get_windows_drives(): def get_windows_drives():
from ctypes import windll from ctypes import windll

View File

@ -29,13 +29,13 @@ build:
requirements: requirements:
build: build:
- python >=3.5.0 - python >=3.5.1
- setuptools - setuptools
- numpy - numpy
- pyelftools - pyelftools
- binutils-or1k-linux - binutils-or1k-linux
run: run:
- python >=3.5.0 - python >=3.5.1
- llvmlite-artiq - llvmlite-artiq
- scipy - scipy
- numpy - numpy

View File

@ -7,8 +7,8 @@ import os
import versioneer import versioneer
if sys.version_info[:3] < (3, 5, 0): if sys.version_info[:3] < (3, 5, 1):
raise Exception("You need Python 3.5.0+") raise Exception("You need Python 3.5.1+")
requirements = [ requirements = [