Permalink
Browse files

Set after server dies raises AttributeError.

  • Loading branch information...
1 parent c5459d4 commit 020c5f04f8b2019bc1d01d88446cd8bd35fd2fdb Sean Reifschneider committed Mar 31, 2013
Showing with 5 additions and 2 deletions.
  1. +3 −0 ChangeLog
  2. +2 −2 memcache.py
View
@@ -1,3 +1,6 @@
+ * Doing a "set" after server goes away, raised AttributeError:
+ 'NoneType' object has no attribute 'sendall'. Patch by Ken Lalonde
+
* incr/decr return None instead of 0 on server connection failure.
Suggested by Ivan Virabyan
View
@@ -816,8 +816,8 @@ def _unsafe_set():
except _ConnectionDeadError:
# retry once
try:
- server._get_socket()
- return _unsafe_set()
+ if server._get_socket():
+ return _unsafe_set()
except (_ConnectionDeadError, socket.error), msg:
server.mark_dead(msg)
return 0

0 comments on commit 020c5f0

Please sign in to comment.