From 78fca35a2eb1fb2f1ae021d3c3bc1b5bd838ed9c Mon Sep 17 00:00:00 2001 From: Thomas Bird Date: Mon, 25 Jan 2021 10:25:45 +0000 Subject: [PATCH] missing default argument in spacy v3rc3, little fix for this --- scrubadub/detectors/spacy.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scrubadub/detectors/spacy.py b/scrubadub/detectors/spacy.py index 49dd815c..8ddce454 100644 --- a/scrubadub/detectors/spacy.py +++ b/scrubadub/detectors/spacy.py @@ -139,7 +139,12 @@ def check_spacy_version() -> bool: @staticmethod def check_spacy_model(model) -> bool: """Ensure that the spaCy model is installed.""" - spacy_info = spacy.info() + try: + spacy_info = spacy.info() + except TypeError: + # There is a forgotten default argument in spacy.info in version 3rc3, this try except should be removed + # in the future. + spacy_info = spacy.info(exclude=[]) models = list(spacy_info.get('pipelines', spacy_info.get('models', None)).keys()) if models is None: raise ValueError('Unable to detect spacy models.')