changeset 140:e077dc9f14e5

little fix in irclib concerning ServerConnection.socket Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Sun, 17 Jan 2010 11:12:56 +0100
parents 38eb220142a1
children 46c02cc89f18
files irclib.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/irclib.py
+++ b/irclib.py
@@ -905,12 +905,12 @@ class ServerConnection(Connection):
 
         The string will be padded with appropriate CR LF.
         """
-        if self.socket is None:
+        if not self.socket or self.socket == 'closed':
             raise ServerNotConnectedError, self
         try:
             if self.ssl:
                 self.ssl.write(string.encode('utf-8') + "\r\n")
-            else:
+            elif self.socket and self.socket != 'closed':
                 self.socket.send(string.encode('utf-8') + "\r\n")
             if DEBUG:
                 print "TO SERVER:", string