Unbreak data download

This commit is contained in:
Matthew Honnibal 2017-01-09 23:40:26 +01:00
parent 8ae8b443f1
commit 0f9b8a00a5
2 changed files with 6 additions and 3 deletions

View File

@ -12,7 +12,7 @@ from . import util
def download(lang, force=False, fail_on_exist=True, data_path=None):
if not data_path:
data_path = util.get_data_path()
data_path = util.get_data_path(require_exists=False)
# spaCy uses pathlib, and util.get_data_path returns a pathlib.Path object,
# but sputnik (which we're using below) doesn't use pathlib and requires

View File

@ -32,8 +32,11 @@ def get_lang_class(name):
return LANGUAGES[lang]
def get_data_path():
return _data_path if _data_path.exists() else None
def get_data_path(require_exists=True):
if not require_exists:
return _data_path
else:
return _data_path if _data_path.exists() else None
def set_data_path(path):