diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-02-26 11:05:56 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-02-26 11:05:56 +0100 |
commit | fe83c0a5523b7c7071e2a5e389dbb28314b2a03a (patch) | |
tree | 06af4b7706cb6ed0ad436faafef22c82209374fe /examples | |
parent | 97dd8d0249989b186a67d99a585b709823171241 (diff) | |
download | trollius-fe83c0a5523b7c7071e2a5e389dbb28314b2a03a.tar.gz |
Fix pyflakes warnings: remove unused variables and imports
Diffstat (limited to 'examples')
-rw-r--r-- | examples/cacheclt.py | 1 | ||||
-rw-r--r-- | examples/cachesvr.py | 1 | ||||
-rw-r--r-- | examples/child_process.py | 8 | ||||
-rw-r--r-- | examples/crawl.py | 2 | ||||
-rw-r--r-- | examples/simple_tcp_server.py | 2 | ||||
-rw-r--r-- | examples/subprocess_attach_read_pipe.py | 1 | ||||
-rw-r--r-- | examples/timing_tcp_server.py | 2 |
7 files changed, 4 insertions, 13 deletions
diff --git a/examples/cacheclt.py b/examples/cacheclt.py index d189188..b11a4d1 100644 --- a/examples/cacheclt.py +++ b/examples/cacheclt.py @@ -8,7 +8,6 @@ import asyncio from asyncio import test_utils import json import logging -import sys ARGS = argparse.ArgumentParser(description='Cache client example.') ARGS.add_argument( diff --git a/examples/cachesvr.py b/examples/cachesvr.py index 9c7bda9..ddb79b6 100644 --- a/examples/cachesvr.py +++ b/examples/cachesvr.py @@ -62,7 +62,6 @@ import json import logging import os import random -import sys ARGS = argparse.ArgumentParser(description='Cache server example.') ARGS.add_argument( diff --git a/examples/child_process.py b/examples/child_process.py index 0c12cb9..3fac175 100644 --- a/examples/child_process.py +++ b/examples/child_process.py @@ -16,9 +16,6 @@ except ImportError: sys.path.append(os.path.join(os.path.dirname(__file__), '..')) import asyncio -from asyncio import streams -from asyncio import protocols - if sys.platform == 'win32': from asyncio.windows_utils import Popen, PIPE from asyncio.windows_events import ProactorEventLoop @@ -32,7 +29,6 @@ else: @asyncio.coroutine def connect_write_pipe(file): loop = asyncio.get_event_loop() - protocol = protocols.Protocol() transport, _ = yield from loop.connect_write_pipe(asyncio.Protocol, file) return transport @@ -43,9 +39,9 @@ def connect_write_pipe(file): @asyncio.coroutine def connect_read_pipe(file): loop = asyncio.get_event_loop() - stream_reader = streams.StreamReader(loop=loop) + stream_reader = asyncio.StreamReader(loop=loop) def factory(): - return streams.StreamReaderProtocol(stream_reader) + return asyncio.StreamReaderProtocol(stream_reader) transport, _ = yield from loop.connect_read_pipe(factory, file) return stream_reader, transport diff --git a/examples/crawl.py b/examples/crawl.py index 0e99c82..637fb8e 100644 --- a/examples/crawl.py +++ b/examples/crawl.py @@ -21,7 +21,6 @@ import cgi from http.client import BadStatusLine import logging import re -import signal import sys import time import urllib.parse @@ -510,7 +509,6 @@ class Fetcher: self.response = yield from self.request.get_response() self.body = yield from self.response.read() h_conn = self.response.get_header('connection').lower() - h_t_enc = self.response.get_header('transfer-encoding').lower() if h_conn != 'close': self.request.close(recycle=True) self.request = None diff --git a/examples/simple_tcp_server.py b/examples/simple_tcp_server.py index 0e87d5b..b796d9b 100644 --- a/examples/simple_tcp_server.py +++ b/examples/simple_tcp_server.py @@ -144,7 +144,7 @@ def main(): # creates a client and connects to our server try: - msg = loop.run_until_complete(client()) + loop.run_until_complete(client()) server.stop(loop) finally: loop.close() diff --git a/examples/subprocess_attach_read_pipe.py b/examples/subprocess_attach_read_pipe.py index 8bec652..57a1342 100644 --- a/examples/subprocess_attach_read_pipe.py +++ b/examples/subprocess_attach_read_pipe.py @@ -2,7 +2,6 @@ """Example showing how to attach a read pipe to a subprocess.""" import asyncio import os, sys -from asyncio import subprocess code = """ import os, sys diff --git a/examples/timing_tcp_server.py b/examples/timing_tcp_server.py index cb43a79..883ce6d 100644 --- a/examples/timing_tcp_server.py +++ b/examples/timing_tcp_server.py @@ -158,7 +158,7 @@ def main(): # creates a client and connects to our server try: - msg = loop.run_until_complete(client()) + loop.run_until_complete(client()) server.stop(loop) finally: loop.close() |