diff options
Diffstat (limited to 'netlib')
-rw-r--r-- | netlib/odict.py | 10 | ||||
-rw-r--r-- | netlib/tcp.py | 8 |
2 files changed, 5 insertions, 13 deletions
diff --git a/netlib/odict.py b/netlib/odict.py index 46b74e8e..7c743f4e 100644 --- a/netlib/odict.py +++ b/netlib/odict.py @@ -96,16 +96,6 @@ class ODict: def items(self): return self.lst[:] - def _get_state(self): - return [tuple(i) for i in self.lst] - - def _load_state(self, state): - self.list = [list(i) for i in state] - - @classmethod - def _from_state(klass, state): - return klass([list(i) for i in state]) - def copy(self): """ Returns a copy of this object. diff --git a/netlib/tcp.py b/netlib/tcp.py index 23449baf..8f2ebdf0 100644 --- a/netlib/tcp.py +++ b/netlib/tcp.py @@ -2,6 +2,8 @@ import select, socket, threading, sys, time, traceback from OpenSSL import SSL import certutils +EINTR = 4 + SSLv2_METHOD = SSL.SSLv2_METHOD SSLv3_METHOD = SSL.SSLv3_METHOD SSLv23_METHOD = SSL.SSLv23_METHOD @@ -238,7 +240,7 @@ class SocketCloseMixin(object): #Section 4.2.2.13 of RFC 1122 tells us that a close() with any # pending readable data could lead to an immediate RST being sent. #http://ia600609.us.archive.org/22/items/TheUltimateSo_lingerPageOrWhyIsMyTcpNotReliable/the-ultimate-so_linger-page-or-why-is-my-tcp-not-reliable.html - while self.connection.recv(4096): + while self.connection.recv(4096): # pragma: no cover pass self.connection.close() except (socket.error, SSL.Error, IOError): @@ -420,8 +422,8 @@ class TCPServer(object): while not self.__shutdown_request: try: r, w, e = select.select([self.socket], [], [], poll_interval) - except select.error, ex: - if ex[0] == 4: + except select.error, ex: # pragma: no cover + if ex[0] == EINTR: continue else: raise |