From 99bb5b0de421ed9e8d23f9be2dd07f37667576a7 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 21 Jan 2010 22:40:53 +0100 Subject: [PATCH] fix other issues spotted by pyflakes. --- gunicorn/arbiter.py | 2 +- gunicorn/http/parser.py | 1 - gunicorn/http/request.py | 1 - gunicorn/http/tee.py | 3 ++- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/gunicorn/arbiter.py b/gunicorn/arbiter.py index 6852ebd5..e23f1bde 100644 --- a/gunicorn/arbiter.py +++ b/gunicorn/arbiter.py @@ -142,7 +142,7 @@ class Arbiter(object): except KeyboardInterrupt: self.stop(False) sys.exit(-1) - except Exception, e: + except Exception: self.log.exception("Unhandled exception in main loop.") self.stop(False) sys.exit(-1) diff --git a/gunicorn/http/parser.py b/gunicorn/http/parser.py index c8cbe778..af237cd9 100644 --- a/gunicorn/http/parser.py +++ b/gunicorn/http/parser.py @@ -138,7 +138,6 @@ class HttpParser(object): return False def read_chunk(self, data): - dlen = len(data) if not self.start_offset: i = data.find("\r\n") if i != -1: diff --git a/gunicorn/http/request.py b/gunicorn/http/request.py index 4a839f66..4ad545d5 100644 --- a/gunicorn/http/request.py +++ b/gunicorn/http/request.py @@ -58,7 +58,6 @@ class HttpRequest(object): def read(self): environ = {} headers = [] - remain = CHUNK_SIZE buf = "" buf = read_partial(self.socket, CHUNK_SIZE) i = self.parser.filter_headers(headers, buf) diff --git a/gunicorn/http/tee.py b/gunicorn/http/tee.py index 3e62a0f9..a492a14c 100644 --- a/gunicorn/http/tee.py +++ b/gunicorn/http/tee.py @@ -93,7 +93,8 @@ class TeeInput(object): return self.temp.readline(size) return line - def readlines(self, sizehints=0): + def readlines(self, sizehint=0): + total = 0 lines = [] line = self.readline() while line: