]> granicus.if.org Git - python/commitdiff
asyncio: pyflakes, remove unused import
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 21 Jan 2015 22:39:16 +0000 (23:39 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 21 Jan 2015 22:39:16 +0000 (23:39 +0100)
tests: Remove unused function; inline another function

Lib/asyncio/base_events.py
Lib/asyncio/selector_events.py
Lib/test/test_asyncio/test_streams.py

index 5df5b83b4712122d33f74d613bb3f52a6e1af510..739296b761e9a2f374b16c473b0c08e9434379f6 100644 (file)
@@ -636,7 +636,7 @@ class BaseEventLoop(events.AbstractEventLoop):
 
         try:
             yield from waiter
-        except Exception as exc:
+        except Exception:
             transport.close()
             raise
 
index 4d3e5d9ede8c694777ef1187127facfcc3daf1ce..24f8461509afed065b9cc1d13154c894b20475a6 100644 (file)
@@ -10,7 +10,6 @@ import collections
 import errno
 import functools
 import socket
-import sys
 try:
     import ssl
 except ImportError:  # pragma: no cover
index a18603afa63619f513e6c5dda470481e815be9e3..2273049b81577c0ded9e200cd8a26e90ff58adb8 100644 (file)
@@ -415,10 +415,6 @@ class StreamReaderTests(test_utils.TestCase):
         def set_err():
             stream.set_exception(ValueError())
 
-        @asyncio.coroutine
-        def readline():
-            yield from stream.readline()
-
         t1 = asyncio.Task(stream.readline(), 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):
         stream = asyncio.StreamReader(loop=self.loop)
 
-        @asyncio.coroutine
-        def read_a_line():
-            yield from stream.readline()
-
-        t = asyncio.Task(read_a_line(), loop=self.loop)
+        t = asyncio.Task(stream.readline(), loop=self.loop)
         test_utils.run_briefly(self.loop)
         t.cancel()
         test_utils.run_briefly(self.loop)