Skip to content
Snippets Groups Projects
Commit 6927c39d authored by Sebastien Luttringer's avatar Sebastien Luttringer
Browse files

fix database init

currently db badly create if directory already exists before creation
parent 46f109ea
No related branches found
No related tags found
No related merge requests found
......@@ -45,6 +45,8 @@ class Database(object):
if not istools.isfile(path):
raise Exception("Database must be local")
self.path = os.path.abspath(path)
if not os.path.exists(self.path):
raise Exception("Database not exists")
self.conn = sqlite3.connect(self.path, isolation_level=None)
self.conn.execute("PRAGMA foreign_keys = ON")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment