def __getstate__(self):
        state = super(VariableTree, self).__getstate__()
        if self._parent_ref is not None:
            state['_parent_ref'] = self._parent_ref()
        return state
Return state after dereferencing weakref to parent.
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/vartree.py/VariableTree.__getstate__