Cleanup logging and exception handling.

The syntax and attribute errors raised during a disconnect/reconnect
attempt are now caught and produce nicer log messages.
This commit is contained in:
Lance Stout
2011-05-31 10:23:05 -07:00
parent 1735c194cd
commit 8080b4cae2
2 changed files with 36 additions and 30 deletions

View File

@@ -22,6 +22,8 @@ class FileSocket(_fileobject):
def read(self, size=4096):
"""Read data from the socket as if it were a file."""
if self._sock is None:
return None
data = self._sock.recv(size)
if data is not None:
return data