Skip to content

Commit a008467

Browse files
authored
Update version_signature.py
1 parent e966594 commit a008467

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cve_bin_tool/version_signature.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ def dbname(self) -> str:
4040

4141
def open(self) -> None:
4242
"""Opens connection to sqlite database."""
43-
self.conn = sqlite3.connect(self.dbname)
43+
# Ensure the cache directory exists before connecting
44+
db_path = Path(self.dbname)
45+
db_path.parent.mkdir(parents=True, exist_ok=True)
46+
self.conn = sqlite3.connect(db_path)
4447
self.cursor = self.conn.cursor()
4548

4649
def close(self) -> None:

0 commit comments

Comments
 (0)