summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-02-28 04:31:39 +0000
committerGuido van Rossum <guido@python.org>1998-02-28 04:31:39 +0000
commit1301211b7f5518ae4b5d6e422a2bae6cda8be775 (patch)
tree7d3d3c0cbb300f7f3df14aa6a5b20cbed9cdebc5 /Python/pythonrun.c
parentd79c15059a599e180e35fae7063789acbc8ef812 (diff)
downloadcpython-1301211b7f5518ae4b5d6e422a2bae6cda8be775.tar.gz
Fix the handling of errors in Py_FlushLine() in a few places.
(Basically, the error is cleared... Like almost everywhere else...)
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 4cd0e3f3c2..83a0bc1472 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -676,7 +676,8 @@ PyErr_PrintEx(set_sys_last_vars)
return;
if (PyErr_GivenExceptionMatches(exception, PyExc_SystemExit)) {
- err = Py_FlushLine();
+ if (Py_FlushLine())
+ PyErr_Clear();
fflush(stdout);
if (v == NULL || v == Py_None)
Py_Exit(0);
@@ -714,10 +715,10 @@ PyErr_PrintEx(set_sys_last_vars)
if (f == NULL)
fprintf(stderr, "lost sys.stderr\n");
else {
- err = Py_FlushLine();
+ if (Py_FlushLine())
+ PyErr_Clear();
fflush(stdout);
- if (err == 0)
- err = PyTraceBack_Print(tb, f);
+ err = PyTraceBack_Print(tb, f);
if (err == 0 &&
PyErr_GivenExceptionMatches(exception, PyExc_SyntaxError))
{
@@ -1062,7 +1063,8 @@ call_sys_exitfunc()
Py_DECREF(exitfunc);
}
- Py_FlushLine();
+ if (Py_FlushLine())
+ PyErr_Clear();
}
static void