Create directory if it doesn't exist

This commit is contained in:
Ines Montani 2019-09-12 14:00:01 +02:00
parent aa4ff0baa1
commit 32404e613c

View File

@ -114,6 +114,8 @@ class Lookups(object):
"""
if len(self._tables):
path = ensure_path(path)
if not path.exists():
path.mkdir()
filepath = path / "lookups.bin"
with filepath.open("wb") as file_:
file_.write(self.to_bytes())