def METHOD_NAME(self):
    TestExcInfo = CPyExtType("TestExcInfo",
                         """
                         PyObject* get_exc_info(PyObject* self) {
                             PyObject* typ;
                             PyObject* val;
                             PyObject* tb;
                             PyErr_GetExcInfo(&typ, &val, &tb);
                             Py_XDECREF(val);
                             Py_XDECREF(tb);
                             if (typ == NULL) {
                                 Py_RETURN_NONE;
                            }
                             return typ;
                         }
                         """,
                         tp_methods='{"get_exc_info", (PyCFunction)get_exc_info, METH_NOARGS, ""}'
    )
    tester = TestExcInfo()
    try:
        raise IndexError
    except IndexError:
        exc_type = tester.get_exc_info()
        assert exc_type == IndexError
        # do a second time because this time we won't do a stack walk
        # disabled due to GR-34711
        # exc_type = tester.get_exc_info()
        # assert exc_type == IndexError
    else:
        assert False