summaryrefslogtreecommitdiffstats
path: root/Modules/main.c
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2018-08-07 14:26:58 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2018-08-07 14:26:58 (GMT)
commit8b58468032b8f87993a121c2b43f52648382a529 (patch)
tree08e1d7381466e855e73d90ee541d23c6e6523b5e /Modules/main.c
parente4dcbbd7f4ac18d01c0ec85f64ae98b8281ed403 (diff)
downloadcpython-8b58468032b8f87993a121c2b43f52648382a529.zip
cpython-8b58468032b8f87993a121c2b43f52648382a529.tar.gz
cpython-8b58468032b8f87993a121c2b43f52648382a529.tar.bz2
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.
Diffstat (limited to 'Modules/main.c')
-rw-r--r--Modules/main.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/Modules/main.c b/Modules/main.c
index da3441f..1640758 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -185,7 +185,6 @@ pymain_run_interactive_hook(void)
error:
PySys_WriteStderr("Failed calling sys.__interactivehook__\n");
PyErr_Print();
- PyErr_Clear();
}
@@ -267,7 +266,6 @@ error:
Py_XDECREF(sys_path0);
PySys_WriteStderr("Failed checking if argv[0] is an import path entry\n");
PyErr_Print();
- PyErr_Clear();
return NULL;
}
@@ -1081,7 +1079,6 @@ pymain_run_startup(_PyMain *pymain, _PyCoreConfig *config, PyCompilerFlags *cf)
PyErr_SetFromErrnoWithFilename(PyExc_OSError,
startup);
PyErr_Print();
- PyErr_Clear();
return;
}