def err_set_object(self, exctype, excval):
    fnty = Type.function(Type.void(), [self.pyobj, self.pyobj])
    fn = self._get_function(fnty, name='PyErr_SetObject')
    if isinstance(exctype, str):
        exctype = self.get_c_object(exctype)
    return self.builder.call(fn, (exctype, excval))
def err_set_object(self, exctype, excval):
    fnty = Type.function(Type.void(), [self.pyobj, self.pyobj])
    fn = self._get_function(fnty, name='PyErr_SetObject')
    if isinstance(exctype, str):
        exctype = self.get_c_object(exctype)
    return self.builder.call(fn, (exctype, excval))