summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/filesocket.py
diff options
context:
space:
mode:
authorLance Stout <lance@dingus.local>2011-05-31 10:23:05 -0700
committerLance Stout <lance@dingus.local>2011-05-31 10:23:05 -0700
commit8080b4cae2000ccd5be2eaa442b903d1b180273b (patch)
treeb29eb2b622d5a0fa2c5c0f256a8ba43f680d4cc4 /sleekxmpp/xmlstream/filesocket.py
parent1735c194cdf83b61850bba45044070db6c42d0ac (diff)
downloadslixmpp-8080b4cae2000ccd5be2eaa442b903d1b180273b.tar.gz
slixmpp-8080b4cae2000ccd5be2eaa442b903d1b180273b.tar.bz2
slixmpp-8080b4cae2000ccd5be2eaa442b903d1b180273b.tar.xz
slixmpp-8080b4cae2000ccd5be2eaa442b903d1b180273b.zip
Cleanup logging and exception handling.
The syntax and attribute errors raised during a disconnect/reconnect attempt are now caught and produce nicer log messages.
Diffstat (limited to 'sleekxmpp/xmlstream/filesocket.py')
-rw-r--r--sleekxmpp/xmlstream/filesocket.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/sleekxmpp/xmlstream/filesocket.py b/sleekxmpp/xmlstream/filesocket.py
index 441ff875..fd81864b 100644
--- a/sleekxmpp/xmlstream/filesocket.py
+++ b/sleekxmpp/xmlstream/filesocket.py
@@ -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