From 7f369eb1272d9083600018e66263cc0167abedce Mon Sep 17 00:00:00 2001 From: Dimitur Kirov Date: Wed, 19 Apr 2006 10:47:29 +0000 Subject: [PATCH] drop may fail, we still have to create the table --- src/common/logger.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/common/logger.py b/src/common/logger.py index 97adc3e69..01077cc78 100644 --- a/src/common/logger.py +++ b/src/common/logger.py @@ -241,13 +241,19 @@ class Logger: results = self.cur.fetchall() # Remove before 0.10 except: - self.cur.executescript('DROP TABLE unread_messages;') - self.con.commit() - self.cur.executescript('''CREATE TABLE unread_messages( - message_id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, - jid_id INTEGER - );''') - self.con.commit() + try: + self.cur.executescript('DROP TABLE unread_messages;') + self.con.commit() + except: + pass + try: + self.cur.executescript('''CREATE TABLE unread_messages( + message_id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, + jid_id INTEGER + );''') + self.con.commit() + except: + pass self.con.close() self.jids_already_in = [] self.init_vars()