Skip to content

Commit

Permalink
missing default argument in spacy v3rc3, little fix for this
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Bird committed Jan 25, 2021
1 parent c7c1ef4 commit 78fca35
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scrubadub/detectors/spacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down

0 comments on commit 78fca35

Please sign in to comment.