From c025a0c64b49d8baf174f50c8c094cc3f8ac7706 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 16 Jan 2016 16:18:44 +0100 Subject: [PATCH] * Check for KeyboardInerrupt in parser.__call__ --- spacy/syntax/parser.pyx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spacy/syntax/parser.pyx b/spacy/syntax/parser.pyx index dd4fb3bea..7f89a505c 100644 --- a/spacy/syntax/parser.pyx +++ b/spacy/syntax/parser.pyx @@ -5,6 +5,7 @@ from __future__ import unicode_literals cimport cython from cpython.ref cimport PyObject, Py_INCREF, Py_XDECREF +from cpython.exc cimport PyErr_CheckSignals from libc.stdint cimport uint32_t, uint64_t from libc.string cimport memset, memcpy @@ -109,6 +110,8 @@ cdef class Parser: ) action.do(stcls, action.label) + # Check for KeyboardInterrupt etc. Untested + PyErr_CheckSignals() self.moves.finalize_state(stcls) tokens.set_parse(stcls._sent)