def patchjoint():
    def joint2(*args, **kwargs):
        res = oldjoint(*args, **kwargs)
        def rename2(*args2, **kwargs2):
            oldrename(*args2, **kwargs2)
        oldrename = res.rename
        res.rename = rename2
        return res
    oldjoint = pmc.joint
    pmc.joint = joint2
Patch rename so it doesn't return anything.
dataset/ETHPy150Open rgalanakis/practicalmayapython/src/chapter7/callbacks.py/patchjoint