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'''
|
'''create table unread_messages if there is no such table'''
|
||||||
con = sqlite.connect(logger.LOG_DB_PATH)
|
con = sqlite.connect(logger.LOG_DB_PATH)
|
||||||
cur = con.cursor()
|
cur = con.cursor()
|
||||||
cur.executescript(
|
|
||||||
'''
|
|
||||||
CREATE TABLE unread_messages (
|
|
||||||
message_id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE
|
|
||||||
);
|
|
||||||
'''
|
|
||||||
)
|
|
||||||
try:
|
try:
|
||||||
|
cur.executescript(
|
||||||
|
'''
|
||||||
|
CREATE TABLE unread_messages (
|
||||||
|
message_id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE
|
||||||
|
);
|
||||||
|
'''
|
||||||
|
)
|
||||||
con.commit()
|
con.commit()
|
||||||
gajim.logger.init_vars() # FIXME: is this needed?
|
gajim.logger.init_vars()
|
||||||
except sqlite.OperationalError, e:
|
except sqlite.OperationalError, e:
|
||||||
pass
|
pass
|
||||||
con.close()
|
con.close()
|
||||||
|
|
Loading…
Reference in New Issue