Remove unneeded PyErr_Clear() calls after PyErr_Print(). (GH-8699)

PyErr_Print() always clears the error indicator, so there is no need
to call PyErr_Clear() immediately afterwards.
This commit is contained in:
Zackery Spytz 2018-08-07 08:26:58 -06:00 committed by Serhiy Storchaka
parent e4dcbbd7f4
commit 8b58468032
1 changed files with 0 additions and 3 deletions

View File

@ -185,7 +185,6 @@ pymain_run_interactive_hook(void)
error: error:
PySys_WriteStderr("Failed calling sys.__interactivehook__\n"); PySys_WriteStderr("Failed calling sys.__interactivehook__\n");
PyErr_Print(); PyErr_Print();
PyErr_Clear();
} }
@ -267,7 +266,6 @@ error:
Py_XDECREF(sys_path0); Py_XDECREF(sys_path0);
PySys_WriteStderr("Failed checking if argv[0] is an import path entry\n"); PySys_WriteStderr("Failed checking if argv[0] is an import path entry\n");
PyErr_Print(); PyErr_Print();
PyErr_Clear();
return NULL; return NULL;
} }
@ -1081,7 +1079,6 @@ pymain_run_startup(_PyMain *pymain, _PyCoreConfig *config, PyCompilerFlags *cf)
PyErr_SetFromErrnoWithFilename(PyExc_OSError, PyErr_SetFromErrnoWithFilename(PyExc_OSError,
startup); startup);
PyErr_Print(); PyErr_Print();
PyErr_Clear();
return; return;
} }