# HG changeset patch # User Charly COSTE # Date 1263723176 -3600 # Node ID e077dc9f14e5925cc621945d40ac3dbc937fd55c # Parent 38eb220142a1a68c3cd786b7aecddcb1422ffce0 little fix in irclib concerning ServerConnection.socket Signed-off-by: Charly COSTE diff --git a/irclib.py b/irclib.py --- 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