put executescript in try block
This commit is contained in:
parent
01f5effcef
commit
fbb2ab6a4c
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue