# HG changeset patch # User Charly COSTE # Date 1252102550 -7200 # Node ID 73a30fc1922bb2ed2f216287e0674c16c1b947d6 # Parent a8749705fe946324ecdcd7ebcdede312db5f9ee4 Fixed the XMPP loop (release the lock) Signed-off-by: Charly COSTE diff -r a8749705fe94 -r 73a30fc1922b bot.py --- a/bot.py Fri Sep 04 14:21:48 2009 +0200 +++ b/bot.py Sat Sep 05 00:15:50 2009 +0200 @@ -76,6 +76,7 @@ """[Internal] XMPP infinite loop.""" i = 1 while True: + unlock = False try: if len(self.xmpp_connections) == 1: sleep(0.5) # avoid bot connection being locked all the time @@ -99,9 +100,13 @@ pass except (xml.parsers.expat.ExpatError, xmpp.protocol.XMLNotWellFormed): self.error('=> Debug: invalid stanza', debug=True) + unlock = True except: self.error('[Error] Unkonwn exception on XMPP thread:') traceback.print_exc() + unlock = True + if unlock == True: + c.lock.release() def _xmpp_presence_handler(self, dispatcher, presence):