Mercurial > cpython-lru_cache-weakref
diff Python/peephole.c @ 64223:7ff3fa429721
Issue 8403: Don't mask KeyboardInterrupt during peephole operation.
| author | Raymond Hettinger <python@rcn.com> |
|---|---|
| date | Sun, 22 Aug 2010 08:39:49 +0000 |
| parents | cab14be0ada1 |
| children | 724920a015f7 |
line wrap: on
line diff
--- a/Python/peephole.c Sun Aug 22 07:44:24 2010 +0000 +++ b/Python/peephole.c Sun Aug 22 08:39:49 2010 +0000 @@ -159,13 +159,16 @@ return 0; } if (newconst == NULL) { - PyErr_Clear(); + if(!PyErr_ExceptionMatches(PyExc_KeyboardInterrupt)) + PyErr_Clear(); return 0; } size = PyObject_Size(newconst); - if (size == -1) + if (size == -1) { + if (PyErr_ExceptionMatches(PyExc_KeyboardInterrupt)) + return 0; PyErr_Clear(); - else if (size > 20) { + } else if (size > 20) { Py_DECREF(newconst); return 0; } @@ -219,7 +222,8 @@ return 0; } if (newconst == NULL) { - PyErr_Clear(); + if(!PyErr_ExceptionMatches(PyExc_KeyboardInterrupt)) + PyErr_Clear(); return 0; }
