[Python-checkins] cpython (3.4): asyncio: pyflakes, remove unused import

victor.stinner python-checkins at python.org
Wed Jan 21 23:41:53 CET 2015


https://hg.python.org/cpython/rev/cf91f281fb9f
changeset:   94230:cf91f281fb9f
branch:      3.4
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Wed Jan 21 23:39:16 2015 +0100
summary:
  asyncio: pyflakes, remove unused import

tests: Remove unused function; inline another function

files:
  Lib/asyncio/base_events.py            |   2 +-
  Lib/asyncio/selector_events.py        |   1 -
  Lib/test/test_asyncio/test_streams.py |  10 +---------
  3 files changed, 2 insertions(+), 11 deletions(-)


diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -636,7 +636,7 @@
 
         try:
             yield from waiter
-        except Exception as exc:
+        except Exception:
             transport.close()
             raise
 
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py
--- a/Lib/asyncio/selector_events.py
+++ b/Lib/asyncio/selector_events.py
@@ -10,7 +10,6 @@
 import errno
 import functools
 import socket
-import sys
 try:
     import ssl
 except ImportError:  # pragma: no cover
diff --git a/Lib/test/test_asyncio/test_streams.py b/Lib/test/test_asyncio/test_streams.py
--- a/Lib/test/test_asyncio/test_streams.py
+++ b/Lib/test/test_asyncio/test_streams.py
@@ -415,10 +415,6 @@
         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 @@
     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)

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list