Fixed ignored KeyboardInterrupt exception.

parent b200b18e
...@@ -130,7 +130,11 @@ cdef public void py_input(object parser, char *buf, int *result, int max_size): ...@@ -130,7 +130,11 @@ cdef public void py_input(object parser, char *buf, int *result, int max_size):
if parser.verbose: if parser.verbose:
print '\npy_input: want to read up to %s bytes' % max_size print '\npy_input: want to read up to %s bytes' % max_size
raw = parser.read(max_size) try:
raw = parser.read(max_size)
except KeyboardInterrupt:
raw = ''
buflen = PyInt_AsLong(len(raw)) buflen = PyInt_AsLong(len(raw))
result[0] = buflen result[0] = buflen
memcpy(buf, PyString_AsString(raw), buflen) memcpy(buf, PyString_AsString(raw), buflen)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment