Mercurial > cpython-lru_cache-weakref
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 36879:8d41ddc31e61 | 36881:4706b7a1256c |
|---|---|
| 1024 if (exception == NULL) | 1024 if (exception == NULL) |
| 1025 return; | 1025 return; |
| 1026 PyErr_NormalizeException(&exception, &v, &tb); | 1026 PyErr_NormalizeException(&exception, &v, &tb); |
| 1027 if (exception == NULL) | 1027 if (exception == NULL) |
| 1028 return; | 1028 return; |
| 1029 /* Now we know v != NULL too */ | |
| 1029 if (set_sys_last_vars) { | 1030 if (set_sys_last_vars) { |
| 1030 PySys_SetObject("last_type", exception); | 1031 PySys_SetObject("last_type", exception); |
| 1031 PySys_SetObject("last_value", v); | 1032 PySys_SetObject("last_value", v); |
| 1032 PySys_SetObject("last_traceback", tb); | 1033 PySys_SetObject("last_traceback", tb); |
| 1033 } | 1034 } |
| 1034 hook = PySys_GetObject("excepthook"); | 1035 hook = PySys_GetObject("excepthook"); |
| 1035 if (hook) { | 1036 if (hook) { |
| 1036 PyObject *args = PyTuple_Pack(3, | 1037 PyObject *args = PyTuple_Pack(3, |
| 1037 exception, v ? v : Py_None, tb ? tb : Py_None); | 1038 exception, v, tb ? tb : Py_None); |
| 1038 PyObject *result = PyEval_CallObject(hook, args); | 1039 PyObject *result = PyEval_CallObject(hook, args); |
| 1039 if (result == NULL) { | 1040 if (result == NULL) { |
| 1040 PyObject *exception2, *v2, *tb2; | 1041 PyObject *exception2, *v2, *tb2; |
| 1041 if (PyErr_ExceptionMatches(PyExc_SystemExit)) { | 1042 if (PyErr_ExceptionMatches(PyExc_SystemExit)) { |
| 1042 handle_system_exit(); | 1043 handle_system_exit(); |
