diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-04-09 02:09:33 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-04-09 02:09:33 +0200 |
commit | e58f76aec1db9cc784a3b73c3050d010bb084968 (patch) | |
tree | 9246b960a95e82953cd8e49e0423e8166ec20543 /netlib/tcp.py | |
parent | 7f7ccd3a1865e8e73f3d1813182d01c607d6e501 (diff) | |
download | mitmproxy-e58f76aec1db9cc784a3b73c3050d010bb084968.tar.gz mitmproxy-e58f76aec1db9cc784a3b73c3050d010bb084968.tar.bz2 mitmproxy-e58f76aec1db9cc784a3b73c3050d010bb084968.zip |
fix code smell
Diffstat (limited to 'netlib/tcp.py')
-rw-r--r-- | netlib/tcp.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/netlib/tcp.py b/netlib/tcp.py index 20e7d45f..10269aa4 100644 --- a/netlib/tcp.py +++ b/netlib/tcp.py @@ -64,7 +64,7 @@ class SSLKeyLogger(object): log_ssl_key = SSLKeyLogger.create_logfun(os.getenv("MITMPROXY_SSLKEYLOGFILE") or os.getenv("SSLKEYLOGFILE")) -class _FileLike: +class _FileLike(object): BLOCKSIZE = 1024 * 32 def __init__(self, o): self.o = o @@ -134,8 +134,8 @@ class Writer(_FileLike): r = self.o.write(v) self.add_log(v[:r]) return r - except (SSL.Error, socket.error), v: - raise NetLibDisconnect(str(v)) + except (SSL.Error, socket.error) as e: + raise NetLibDisconnect(str(e)) class Reader(_FileLike): @@ -546,10 +546,10 @@ class TCPServer(object): try: r, w, e = select.select([self.socket], [], [], poll_interval) except select.error as ex: # pragma: no cover - if ex[0] == EINTR: - continue - else: - raise + if ex[0] == EINTR: + continue + else: + raise if self.socket in r: connection, client_address = self.socket.accept() t = threading.Thread( |