def get_c_cleanup(r, name, sub):
    """
    Wrapper around c_cleanup that decrefs py_name.

    """
    post = """
    {Py_XDECREF(py_%(name)s);}
    """ % locals()
    return r.type.c_cleanup(name, sub) + post