'Return if an exception occurred.'

def check_occurred(self):

    err_occurred = cgutils.is_not_null(self.builder, self.pyapi.err_occurred())
    with cgutils.if_unlikely(self.builder, err_occurred):
        self.return_exception_raised()
