pamhyr: Close study DB if already init.

This commit is contained in:
Pierre-Antoine Rouby committed 2024-03-22 14:03:46 +01:00
1 parent 334ada3dcc
commit 0f25334032
1 file changed
+3 -1
+3 -1
View File
@@ -35,8 +35,10 @@ class SQLModel(SQL):
_sub_classes = []
def _init_db_file(self, db, is_new=True):
exists = Path(db).exists()
if self._db is not None:
self._db.close()
exists = Path(db).exists()
if exists and is_new:
os.remove(db)