Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions examples/ttt.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from socket import (socket, AF_INET, SOCK_STREAM, IPPROTO_TCP)
from socket import timeout as socket_timeout
from socket import error as socket_error
from errno import EAGAIN
import errno
import json


Expand Down Expand Up @@ -286,7 +286,7 @@ def do_communication (self):
except socket_timeout:
pass
except socket_error as e:
if e.errno != EAGAIN: raise
if e.errno != errno.EAGAIN: raise
except Exception:
add_hist("Socket send error")
self.close()
Expand All @@ -304,8 +304,10 @@ def do_communication (self):
msg,self.inbuf = self.inbuf.split(b"\n", 1)
msg = json.loads(msg)
msgs.append(msg)
except WindowsError as e:
if e.winerror != errno.WSAEWOULDBLOCK: raise
except socket_error as e:
if e.errno != EAGAIN: raise
if e.errno != errno.EAGAIN: raise
except socket_timeout:
pass
except Exception as e:
Expand Down