put executescript in try block

This commit is contained in:
Dimitur Kirov 2006-04-11 08:16:22 +00:00
parent 01f5effcef
commit fbb2ab6a4c
1 changed files with 8 additions and 8 deletions

View File

@ -39,16 +39,16 @@ def assert_unread_msgs_table_exists():
'''create table unread_messages if there is no such table'''
con = sqlite.connect(logger.LOG_DB_PATH)
cur = con.cursor()
cur.executescript(
'''
CREATE TABLE unread_messages (
message_id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE
);
'''
)
try:
cur.executescript(
'''
CREATE TABLE unread_messages (
message_id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE
);
'''
)
con.commit()
gajim.logger.init_vars() # FIXME: is this needed?
gajim.logger.init_vars()
except sqlite.OperationalError, e:
pass
con.close()