Thread safety, Disable toolbar context menu

This commit is contained in:
BasioMeusPuga
2017-11-19 23:52:32 +05:30
parent 6ca94924cf
commit 155ef22089
4 changed files with 42 additions and 25 deletions

View File

@@ -119,7 +119,11 @@ class DatabaseFunctions:
pickled_position = pickle.dumps(position)
sql_command = "UPDATE books SET Position = ? WHERE Hash = ?"
self.database.execute(sql_command, [sqlite3.Binary(pickled_position), file_hash])
try:
self.database.execute(sql_command, [sqlite3.Binary(pickled_position), file_hash])
except sqlite3.OperationalError:
print('SQLite is in rebellion, Commander')
return
self.database.commit()
self.close_database()