From d078b47c81acdce5ece828f2f7d6e193bb3840ce Mon Sep 17 00:00:00 2001 From: adrianeboyd Date: Tue, 3 Mar 2020 12:29:05 +0100 Subject: [PATCH] Break out of infinite loop as intended (#5077) --- spacy/tokens/doc.pyx | 1 + 1 file changed, 1 insertion(+) diff --git a/spacy/tokens/doc.pyx b/spacy/tokens/doc.pyx index 11f1ddf5f..5997be804 100644 --- a/spacy/tokens/doc.pyx +++ b/spacy/tokens/doc.pyx @@ -1175,6 +1175,7 @@ cdef int set_children_from_heads(TokenC* tokens, int length) except -1: heads_within_sents = _set_lr_kids_and_edges(tokens, length, loop_count) if loop_count > 10: user_warning(Warnings.W026) + break loop_count += 1 # Set sentence starts for i in range(length):