Mercurial > xib
changeset 146:229a59acde0f
fixes in irclib, needed because ServerConnection.socket can be a string since 42d7b622776196149c9a9a05da134a85ee9509c6
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Sun, 17 Jan 2010 19:14:41 +0100 |
parents | ddc87b605019 |
children | 0aa31a2b9316 |
files | irclib.py |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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