* Check for KeyboardInerrupt in parser.__call__

This commit is contained in:
Matthew Honnibal 2016-01-16 16:18:44 +01:00
parent 03e8a4293d
commit c025a0c64b
1 changed files with 3 additions and 0 deletions

View File

@ -5,6 +5,7 @@ from __future__ import unicode_literals
cimport cython cimport cython
from cpython.ref cimport PyObject, Py_INCREF, Py_XDECREF 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.stdint cimport uint32_t, uint64_t
from libc.string cimport memset, memcpy from libc.string cimport memset, memcpy
@ -109,6 +110,8 @@ cdef class Parser:
) )
action.do(stcls, action.label) action.do(stcls, action.label)
# Check for KeyboardInterrupt etc. Untested
PyErr_CheckSignals()
self.moves.finalize_state(stcls) self.moves.finalize_state(stcls)
tokens.set_parse(stcls._sent) tokens.set_parse(stcls._sent)