asyncio: pyflakes, remove unused import

tests: Remove unused function; inline another function
This commit is contained in:
Victor Stinner 2015-01-21 23:39:16 +01:00
parent cd0f7f9832
commit 442b0adccd
3 changed files with 2 additions and 11 deletions

View file

@ -636,7 +636,7 @@ class BaseEventLoop(events.AbstractEventLoop):
try: try:
yield from waiter yield from waiter
except Exception as exc: except Exception:
transport.close() transport.close()
raise raise

View file

@ -10,7 +10,6 @@ import collections
import errno import errno
import functools import functools
import socket import socket
import sys
try: try:
import ssl import ssl
except ImportError: # pragma: no cover except ImportError: # pragma: no cover

View file

@ -415,10 +415,6 @@ class StreamReaderTests(test_utils.TestCase):
def set_err(): def set_err():
stream.set_exception(ValueError()) stream.set_exception(ValueError())
@asyncio.coroutine
def readline():
yield from stream.readline()
t1 = asyncio.Task(stream.readline(), loop=self.loop) t1 = asyncio.Task(stream.readline(), loop=self.loop)
t2 = asyncio.Task(set_err(), loop=self.loop) t2 = asyncio.Task(set_err(), loop=self.loop)
@ -429,11 +425,7 @@ class StreamReaderTests(test_utils.TestCase):
def test_exception_cancel(self): def test_exception_cancel(self):
stream = asyncio.StreamReader(loop=self.loop) stream = asyncio.StreamReader(loop=self.loop)
@asyncio.coroutine t = asyncio.Task(stream.readline(), loop=self.loop)
def read_a_line():
yield from stream.readline()
t = asyncio.Task(read_a_line(), loop=self.loop)
test_utils.run_briefly(self.loop) test_utils.run_briefly(self.loop)
t.cancel() t.cancel()
test_utils.run_briefly(self.loop) test_utils.run_briefly(self.loop)