summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 113ff2d61a..d89e5e9913 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -1435,7 +1435,8 @@ err_input(perrdetail *err)
msg = "EOL while scanning single-quoted string";
break;
case E_INTR:
- PyErr_SetNone(PyExc_KeyboardInterrupt);
+ if (!PyErr_Occurred())
+ PyErr_SetNone(PyExc_KeyboardInterrupt);
Py_XDECREF(v);
return;
case E_NOMEM: