From 84341c2975b82e711fff31ff3a3f062a465beb9e Mon Sep 17 00:00:00 2001 From: ines Date: Fri, 14 Apr 2017 16:48:02 +0200 Subject: [PATCH] Only compile list of models if data_path exists --- spacy/cli/info.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spacy/cli/info.py b/spacy/cli/info.py index 878f3ed5f..eae0593a4 100644 --- a/spacy/cli/info.py +++ b/spacy/cli/info.py @@ -49,5 +49,6 @@ def list_models(): # won't show up in list, but it seems worth it exclude = ['cache', 'pycache', '__pycache__'] data_path = util.get_data_path() - models = [f.parts[-1] for f in data_path.iterdir() if f.is_dir()] - return [m for m in models if m not in exclude] + if data_path: + models = [f.parts[-1] for f in data_path.iterdir() if f.is_dir()] + return [m for m in models if m not in exclude]