mirror of https://gitlab.com/pamhyr/pamhyr2
pamhyr: Close study DB if already init.
parent
334ada3dcc
commit
0f25334032
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue