diff --git a/beemstorage/sqlite.py b/beemstorage/sqlite.py index 336a9931381270fb79916b024c69797a1e64b43d..12829343667f5bbaa729d105827cccdd2b7f98a2 100644 --- a/beemstorage/sqlite.py +++ b/beemstorage/sqlite.py @@ -50,13 +50,8 @@ class SQLiteFile: self.sqlite_file = os.path.join(self.data_dir, self.storageDatabase) - """ Ensure that the directory in which the data is stored - exists - """ - if os.path.isdir(self.data_dir): # pragma: no cover - return - else: # pragma: no cover - os.makedirs(self.data_dir) + # Ensure that the directory in which the data is stored exists + os.makedirs(self.data_dir, exist_ok=True) def sqlite3_backup(self, backupdir): """ Create timestamped database copy