mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
pamhyr: Close study DB if already init.
This commit is contained in:
1 parent
334ada3dcc
commit
0f25334032
1 file changed
+3
-1
@@ -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)
|
||||
|
||||
|
||||
Reference in new issue
Block a user