diff options
author | Aldo Cortesi <aldo@corte.si> | 2018-04-18 08:22:26 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@corte.si> | 2018-04-18 08:22:26 +1200 |
commit | bca0275427e5879e49cd91d0802e51052a8000d1 (patch) | |
tree | f44f1bd608aadfd0c58b9a24b6b4dbea58f25f28 | |
parent | 8396244729f67ab5ca3c750b280aef2bc0b34006 (diff) | |
download | mitmproxy-bca0275427e5879e49cd91d0802e51052a8000d1.tar.gz mitmproxy-bca0275427e5879e49cd91d0802e51052a8000d1.tar.bz2 mitmproxy-bca0275427e5879e49cd91d0802e51052a8000d1.zip |
tcp: As of Python 3.5, EINTR is retried automatically by select
See https://www.python.org/dev/peps/pep-0475/
-rw-r--r-- | mitmproxy/net/tcp.py | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/mitmproxy/net/tcp.py b/mitmproxy/net/tcp.py index b842f11f..5e53e398 100644 --- a/mitmproxy/net/tcp.py +++ b/mitmproxy/net/tcp.py @@ -22,8 +22,6 @@ socket_fileobject = socket.SocketIO # Python 3.6 for Windows is missing a constant IPPROTO_IPV6 = getattr(socket, "IPPROTO_IPV6", 41) -EINTR = 4 - class _FileLike: BLOCKSIZE = 1024 * 32 @@ -595,14 +593,7 @@ class TCPServer: self.__is_shut_down.clear() try: while not self.__shutdown_request: - 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 + r, w_, e_ = select.select([self.socket], [], [], poll_interval) if self.socket in r: connection, client_address = self.socket.accept() t = basethread.BaseThread( |