aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Include/internal/pycore_pyerrors.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/internal/pycore_pyerrors.h')
-rw-r--r--Include/internal/pycore_pyerrors.h12
1 files changed, 2 insertions, 10 deletions
diff --git a/Include/internal/pycore_pyerrors.h b/Include/internal/pycore_pyerrors.h
index 5e8d2025dfa..b9fc36cf067 100644
--- a/Include/internal/pycore_pyerrors.h
+++ b/Include/internal/pycore_pyerrors.h
@@ -24,16 +24,7 @@ static inline PyObject* _PyErr_Occurred(PyThreadState *tstate)
static inline void _PyErr_ClearExcState(_PyErr_StackItem *exc_state)
{
- PyObject *t, *v, *tb;
- t = exc_state->exc_type;
- v = exc_state->exc_value;
- tb = exc_state->exc_traceback;
- exc_state->exc_type = NULL;
- exc_state->exc_value = NULL;
- exc_state->exc_traceback = NULL;
- Py_XDECREF(t);
- Py_XDECREF(v);
- Py_XDECREF(tb);
+ Py_CLEAR(exc_state->exc_value);
}
PyAPI_FUNC(PyObject*) _PyErr_StackItemToExcInfoTuple(
@@ -114,6 +105,7 @@ PyAPI_FUNC(void) _Py_NO_RETURN _Py_FatalRefcountErrorFunc(
#define _Py_FatalRefcountError(message) _Py_FatalRefcountErrorFunc(__func__, message)
+
#ifdef __cplusplus
}
#endif