Skip to content

Commit

Permalink
fix/database: creating db_file parent directory if it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
kaykanloo committed May 3, 2020
1 parent d80a966 commit d77b3ef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nboost/database.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import time
from typing import Optional
from sqlite3 import Cursor
Expand All @@ -7,6 +8,7 @@

class Database:
def __init__(self, db_file: type(defaults.db_file) = defaults.db_file, **_):
os.makedirs(db_file.parent, exist_ok=True)
self.db_file = db_file

def new_row(self):
Expand Down

0 comments on commit d77b3ef

Please sign in to comment.