mirror of https://github.com/python/cpython
Issue 8403: Don't mask KeyboardInterrupt during peephole operation.
This commit is contained in:
parent
9117c75148
commit
819a064556
|
@ -159,13 +159,16 @@ fold_binops_on_constants(unsigned char *codestr, PyObject *consts)
|
|||
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 @@ fold_unaryops_on_constants(unsigned char *codestr, PyObject *consts)
|
|||
return 0;
|
||||
}
|
||||
if (newconst == NULL) {
|
||||
PyErr_Clear();
|
||||
if(!PyErr_ExceptionMatches(PyExc_KeyboardInterrupt))
|
||||
PyErr_Clear();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue