Issue #27703: Got rid of unnecessary NULL checks in do_raise() in release mode.
Patch by Xiang Zhang.
This commit is contained in:
parent
2f63faefdf
commit
c019158a4c
|
@ -4245,6 +4245,9 @@ do_raise(PyObject *exc, PyObject *cause)
|
||||||
goto raise_error;
|
goto raise_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(type != NULL);
|
||||||
|
assert(value != NULL);
|
||||||
|
|
||||||
if (cause) {
|
if (cause) {
|
||||||
PyObject *fixed_cause;
|
PyObject *fixed_cause;
|
||||||
if (PyExceptionClass_Check(cause)) {
|
if (PyExceptionClass_Check(cause)) {
|
||||||
|
@ -4271,8 +4274,8 @@ do_raise(PyObject *exc, PyObject *cause)
|
||||||
|
|
||||||
PyErr_SetObject(type, value);
|
PyErr_SetObject(type, value);
|
||||||
/* PyErr_SetObject incref's its arguments */
|
/* PyErr_SetObject incref's its arguments */
|
||||||
Py_XDECREF(value);
|
Py_DECREF(value);
|
||||||
Py_XDECREF(type);
|
Py_DECREF(type);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
raise_error:
|
raise_error:
|
||||||
|
|
Loading…
Reference in New Issue