aboutsummaryrefslogtreecommitdiffstats
path: root/netlib
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2013-02-24 11:08:43 +1300
committerAldo Cortesi <aldo@nullcube.com>2013-02-24 11:08:43 +1300
commitc6f9a2d74dc0b2d9185743a02e4c1410983f0c3f (patch)
tree9894cfdcbd22ae49b6ae7d51c7b20a2438b7d922 /netlib
parent7d185356655fa2f40c452c273a3cd039360d20c1 (diff)
downloadmitmproxy-c6f9a2d74dc0b2d9185743a02e4c1410983f0c3f.tar.gz
mitmproxy-c6f9a2d74dc0b2d9185743a02e4c1410983f0c3f.tar.bz2
mitmproxy-c6f9a2d74dc0b2d9185743a02e4c1410983f0c3f.zip
More accurate description of an HTTP read error, make pyflakes happy.
Diffstat (limited to 'netlib')
-rw-r--r--netlib/certutils.py2
-rw-r--r--netlib/http.py2
-rw-r--r--netlib/tcp.py4
-rw-r--r--netlib/wsgi.py8
4 files changed, 8 insertions, 8 deletions
diff --git a/netlib/certutils.py b/netlib/certutils.py
index e1407936..b3ba1dcf 100644
--- a/netlib/certutils.py
+++ b/netlib/certutils.py
@@ -1,4 +1,4 @@
-import os, ssl, hashlib, socket, time, datetime, tempfile, shutil
+import os, ssl, time, datetime, tempfile, shutil
from pyasn1.type import univ, constraint, char, namedtype, tag
from pyasn1.codec.der.decoder import decode
from pyasn1.error import PyAsn1Error
diff --git a/netlib/http.py b/netlib/http.py
index 076baf87..29bcf43d 100644
--- a/netlib/http.py
+++ b/netlib/http.py
@@ -279,7 +279,7 @@ def read_response(rfile, method, body_size_limit):
if line == "\r\n" or line == "\n": # Possible leftover from previous message
line = rfile.readline()
if not line:
- raise HttpError(502, "Blank server response.")
+ raise HttpError(502, "Server disconnect.")
parts = line.strip().split(" ", 2)
if len(parts) == 2: # handle missing message gracefully
parts.append("")
diff --git a/netlib/tcp.py b/netlib/tcp.py
index 556f97ac..0a15d2ac 100644
--- a/netlib/tcp.py
+++ b/netlib/tcp.py
@@ -139,7 +139,7 @@ class Reader(_FileLike):
raise NetLibTimeout
except socket.error:
raise NetLibDisconnect
- except SSL.SysCallError, v:
+ except SSL.SysCallError:
raise NetLibDisconnect
self.first_byte_timestamp = self.first_byte_timestamp or time.time()
if not data:
@@ -322,7 +322,7 @@ class BaseHandler:
self.connection.shutdown()
else:
self.connection.shutdown(socket.SHUT_RDWR)
- except (socket.error, SSL.Error), v:
+ except (socket.error, SSL.Error):
# Socket probably already closed
pass
self.connection.close()
diff --git a/netlib/wsgi.py b/netlib/wsgi.py
index 4fa2c537..dffc2ace 100644
--- a/netlib/wsgi.py
+++ b/netlib/wsgi.py
@@ -1,4 +1,4 @@
-import cStringIO, urllib, time, sys, traceback
+import cStringIO, urllib, time, traceback
import odict
@@ -128,13 +128,13 @@ class WSGIAdaptor:
write(i)
if not state["headers_sent"]:
write("")
- except Exception, v:
+ except Exception:
try:
s = traceback.format_exc()
errs.write(s)
self.error_page(soc, state["headers_sent"], s)
- except Exception, v: # pragma: no cover
- pass # pragma: no cover
+ except Exception: # pragma: no cover
+ pass
return errs.getvalue()