diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-09-20 19:56:45 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-09-20 19:56:45 +0200 |
commit | 0ad5cbc6bf5e9c4d0b5af85544b77dcb29cddb56 (patch) | |
tree | 89338e320bb913147ee19dfc250ad5891680057b /netlib | |
parent | 693cdfc6d75e460a00585ccc9b734b80d6eba74d (diff) | |
download | mitmproxy-0ad5cbc6bf5e9c4d0b5af85544b77dcb29cddb56.tar.gz mitmproxy-0ad5cbc6bf5e9c4d0b5af85544b77dcb29cddb56.tar.bz2 mitmproxy-0ad5cbc6bf5e9c4d0b5af85544b77dcb29cddb56.zip |
python3++
Diffstat (limited to 'netlib')
-rw-r--r-- | netlib/tcp.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/netlib/tcp.py b/netlib/tcp.py index 6dcc8c72..f6f7d06f 100644 --- a/netlib/tcp.py +++ b/netlib/tcp.py @@ -7,6 +7,8 @@ import threading import time import traceback +from six.moves import range + import certifi import six import OpenSSL @@ -227,7 +229,7 @@ class Reader(_FileLike): return result def readline(self, size=None): - result = '' + result = b'' bytes_read = 0 while True: if size is not None and bytes_read >= size: @@ -399,7 +401,7 @@ def close_socket(sock): sock.settimeout(sock.gettimeout() or 20) # limit at a megabyte so that we don't read infinitely - for _ in xrange(1024 ** 3 // 4096): + for _ in range(1024 ** 3 // 4096): # may raise a timeout/disconnect exception. if not sock.recv(4096): break @@ -649,7 +651,7 @@ class TCPClient(_Connection): if OpenSSL._util.lib.Cryptography_HAS_ALPN and self.ssl_established: return self.connection.get_alpn_proto_negotiated() else: - return "" + return b"" class BaseHandler(_Connection): |