From 27493f2ed7573236995447257aca51354d0db12b Mon Sep 17 00:00:00 2001 From: Guillaume Raffy Date: Fri, 15 Nov 2024 16:40:23 +0100 Subject: [PATCH] fixed logic error foudn when working on [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3979] --- cocluto/SimpaDbUtil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocluto/SimpaDbUtil.py b/cocluto/SimpaDbUtil.py index f244f42..35d8429 100644 --- a/cocluto/SimpaDbUtil.py +++ b/cocluto/SimpaDbUtil.py @@ -253,7 +253,7 @@ class SqliteDb(ISqlDatabaseBackend): # If set False, the returned connection may be shared across multiple threads. When using multiple threads with the same connection writing operations should be serialized by the user to avoid data corruption # I hope it's safe here but I'm not 100% sure though. Anyway, if the database gets corrupt, it not a big deal since this memory resident database gets reconstructed from the sql file... - if sqlite_db_path != ':memory:' and not sqlite_db_path.exists(): + if sqlite_db_path == ':memory:' or not sqlite_db_path.exists(): logging.debug('creating sqlite database in %s', sqlite_db_path) self._con = sqlite3.connect(sqlite_db_path, check_same_thread=check_same_thread) else: