From 32404e613c85151d059e596fd5457bafcf67fdc2 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Thu, 12 Sep 2019 14:00:01 +0200 Subject: [PATCH] Create directory if it doesn't exist --- spacy/lookups.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spacy/lookups.py b/spacy/lookups.py index 741d40330..e639009df 100644 --- a/spacy/lookups.py +++ b/spacy/lookups.py @@ -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())