diff --git a/param/parameterized.py b/param/parameterized.py index e470f1deb..31adc0b72 100644 --- a/param/parameterized.py +++ b/param/parameterized.py @@ -2218,13 +2218,22 @@ def __getstate__(self): return state - def __setstate__(self,state): + def __setstate__(self, state): """ Restore objects from the state dictionary to this object. During this process the object is considered uninitialized. """ self.initialized=False + + # Handle renamed slots introduced for instance params + if '_attrib_name' in state: + state['name'] = state.pop('_attrib_name') + if '_owner' in state: + state['owner'] = state.pop('_owner') + if '_instance__params' not in state: + state['_instance__params'] = {} + for name,value in state.items(): setattr(self,name,value) self.initialized=True