From 6a00de4f77f1391744f914ebe8f957e1da43a73e Mon Sep 17 00:00:00 2001 From: ines Date: Wed, 25 Oct 2017 14:56:35 +0200 Subject: [PATCH] Fix check of unexpected pipe names in restore() --- spacy/language.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/language.py b/spacy/language.py index 5a85a83ec..05dc32783 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -700,7 +700,7 @@ class DisabledPipes(list): def restore(self): '''Restore the pipeline to its state when DisabledPipes was created.''' current, self.nlp.pipeline = self.nlp.pipeline, self.original_pipeline - unexpected = [name for name in current if not self.nlp.has_pipe(name)] + unexpected = [name for name, pipe in current if not self.nlp.has_pipe(name)] if unexpected: # Don't change the pipeline if we're raising an error. self.nlp.pipeline = current