# 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 --git a/bot.py b/bot.py --- a/bot.py +++ b/bot.py @@ -76,6 +76,7 @@ class bot(Thread): """[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 @@ class bot(Thread): 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):