diff Python/pythonrun.c @ 36881:4706b7a1256c legacy-trunk

Address an coverity issue. Coverity was complaining about a line that's fine, but an earlier line checked for v != NULL unnecessarily.
author Guido van Rossum <guido@python.org>
date Tue, 07 Mar 2006 18:31:44 +0000
parents 4f628ecc30cb
children 49c6eb688906 6e1a899cac8e
line wrap: on
line diff
--- a/Python/pythonrun.c	Tue Mar 07 16:16:07 2006 +0000
+++ b/Python/pythonrun.c	Tue Mar 07 18:31:44 2006 +0000
@@ -1026,6 +1026,7 @@
 	PyErr_NormalizeException(&exception, &v, &tb);
 	if (exception == NULL)
 		return;
+        /* Now we know v != NULL too */
 	if (set_sys_last_vars) {
 		PySys_SetObject("last_type", exception);
 		PySys_SetObject("last_value", v);
@@ -1034,7 +1035,7 @@
 	hook = PySys_GetObject("excepthook");
 	if (hook) {
 		PyObject *args = PyTuple_Pack(3,
-		    exception, v ? v : Py_None, tb ? tb : Py_None);
+		    exception, v, tb ? tb : Py_None);
 		PyObject *result = PyEval_CallObject(hook, args);
 		if (result == NULL) {
 			PyObject *exception2, *v2, *tb2;