Mercurial > xib
comparison irclib.py @ 163:54c0e77370fd
fixed irclib.ServerConnection.disconnect()
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Tue, 19 Jan 2010 21:27:34 +0100 |
parents | da2f2dc61e74 |
children | 6b91ca42df98 |
comparison
equal
deleted
inserted
replaced
162:7af07b7bf6fd | 163:54c0e77370fd |
---|---|
747 | 747 |
748 Arguments: | 748 Arguments: |
749 | 749 |
750 message -- Quit message. | 750 message -- Quit message. |
751 """ | 751 """ |
752 if not self.connected: | |
753 return | |
754 | 752 |
755 self.lock.acquire() | 753 self.lock.acquire() |
756 | 754 |
757 self.connected = False | 755 if self.connected: |
758 | 756 self.connected = False |
759 self.quit(message) | 757 |
760 | 758 if self.socket and self.socket != 'closed': |
761 try: | 759 self.quit(message) |
762 self.socket.close() | 760 |
763 except socket.error, x: | 761 try: |
764 pass | 762 self.socket.close() |
765 self.socket = 'closed' | 763 except socket.error, x: |
764 pass | |
765 self.socket = 'closed' | |
766 | |
766 self.lock.release() | 767 self.lock.release() |
767 | 768 |
768 if volontary == False: | 769 if volontary == False: |
769 self._handle_event(Event("disconnect", self.server, "", [message])) | 770 self._handle_event(Event("disconnect", self.server, "", [message])) |
770 | 771 |