# HG changeset patch # User Charly COSTE # Date 1263752081 -3600 # Node ID 229a59acde0f26fb85f60055ae8b2b61a1a1d91a # Parent ddc87b605019efd54960cc470320a5d9b2e47a58 fixes in irclib, needed because ServerConnection.socket can be a string since 42d7b622776196149c9a9a05da134a85ee9509c6 Signed-off-by: Charly COSTE diff --git a/irclib.py b/irclib.py --- a/irclib.py +++ b/irclib.py @@ -241,7 +241,7 @@ class IRC: at the process_forever method. """ sockets = map(lambda x: x._get_socket(), self.connections) - sockets = filter(lambda x: x != None, sockets) + sockets = filter(lambda x: x and not isinstance(x, basestring), sockets) if sockets: (i, o, e) = select.select(sockets, [], [], timeout) self.process_data(i) @@ -905,12 +905,12 @@ class ServerConnection(Connection): The string will be padded with appropriate CR LF. """ - if not self.socket or self.socket == 'closed': + if not self.socket or isinstance(self.socket, basestring): raise ServerNotConnectedError, self try: if self.ssl: self.ssl.write(string.encode('utf-8') + "\r\n") - elif self.socket and self.socket != 'closed': + else: self.socket.send(string.encode('utf-8') + "\r\n") if DEBUG: print "TO SERVER:", string