mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-11 08:42:28 +03:00
Ensure that download command exits properly (resolves #1714)
This commit is contained in:
parent
1081e08efb
commit
dacfaa2ca4
|
@ -31,7 +31,10 @@ def download(cmd, model, direct=False):
|
||||||
version = get_version(model_name, compatibility)
|
version = get_version(model_name, compatibility)
|
||||||
dl = download_model('{m}-{v}/{m}-{v}.tar.gz'.format(m=model_name,
|
dl = download_model('{m}-{v}/{m}-{v}.tar.gz'.format(m=model_name,
|
||||||
v=version))
|
v=version))
|
||||||
if dl == 0:
|
if dl != 0:
|
||||||
|
# if download subprocess doesn't return 0, exit with the respective
|
||||||
|
# exit code before doing anything else
|
||||||
|
sys.exit(dl)
|
||||||
try:
|
try:
|
||||||
# Get package path here because link uses
|
# Get package path here because link uses
|
||||||
# pip.get_installed_distributions() to check if model is a
|
# pip.get_installed_distributions() to check if model is a
|
||||||
|
|
Loading…
Reference in New Issue
Block a user