mirror of
https://github.com/python/cpython.git
synced 2025-09-09 18:32:22 +00:00
Fix the handling of errors in Py_FlushLine() in a few places.
(Basically, the error is cleared... Like almost everywhere else...)
This commit is contained in:
parent
10026de6a3
commit
0829c754bb
1 changed files with 7 additions and 5 deletions
|
@ -676,7 +676,8 @@ PyErr_PrintEx(set_sys_last_vars)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (PyErr_GivenExceptionMatches(exception, PyExc_SystemExit)) {
|
if (PyErr_GivenExceptionMatches(exception, PyExc_SystemExit)) {
|
||||||
err = Py_FlushLine();
|
if (Py_FlushLine())
|
||||||
|
PyErr_Clear();
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
if (v == NULL || v == Py_None)
|
if (v == NULL || v == Py_None)
|
||||||
Py_Exit(0);
|
Py_Exit(0);
|
||||||
|
@ -714,10 +715,10 @@ PyErr_PrintEx(set_sys_last_vars)
|
||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
fprintf(stderr, "lost sys.stderr\n");
|
fprintf(stderr, "lost sys.stderr\n");
|
||||||
else {
|
else {
|
||||||
err = Py_FlushLine();
|
if (Py_FlushLine())
|
||||||
|
PyErr_Clear();
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
if (err == 0)
|
err = PyTraceBack_Print(tb, f);
|
||||||
err = PyTraceBack_Print(tb, f);
|
|
||||||
if (err == 0 &&
|
if (err == 0 &&
|
||||||
PyErr_GivenExceptionMatches(exception, PyExc_SyntaxError))
|
PyErr_GivenExceptionMatches(exception, PyExc_SyntaxError))
|
||||||
{
|
{
|
||||||
|
@ -1062,7 +1063,8 @@ call_sys_exitfunc()
|
||||||
Py_DECREF(exitfunc);
|
Py_DECREF(exitfunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_FlushLine();
|
if (Py_FlushLine())
|
||||||
|
PyErr_Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue