From 173089a45ac1465adaaac49fa58b01d262a60b14 Mon Sep 17 00:00:00 2001 From: ines Date: Tue, 29 Aug 2017 11:21:44 +0200 Subject: [PATCH] Add more validation for model meta --- spacy/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/util.py b/spacy/util.py index 645f8b3f7..9d839a25a 100644 --- a/spacy/util.py +++ b/spacy/util.py @@ -169,8 +169,8 @@ def get_model_meta(path): raise IOError("Could not read meta.json from %s" % meta_path) meta = read_json(meta_path) for setting in ['lang', 'name', 'version']: - if setting not in meta: - raise ValueError('No %s setting found in model meta.json' % setting) + if setting not in meta or not meta[setting]: + raise ValueError('No valid '%s' setting found in model meta.json' % setting) return meta