fix the exception about _update_label_buf when copying and pickling

This commit is contained in:
Zhenwen Dai 2014-10-14 10:12:46 +01:00
parent 1a59d527a3
commit 55077161d4

View file

@ -172,7 +172,8 @@ class Parameterized(Parameterizable):
if not isinstance(param,Tie):
self._highest_parent_.ties.mergeTies(param)
else:
self._highest_parent_.ties._update_label_buf()
if hasattr(self._highest_parent_,'ties'):
self._highest_parent_.ties._update_label_buf()
else:
raise HierarchyError, """Parameter exists already, try making a copy"""
@ -220,7 +221,8 @@ class Parameterized(Parameterizable):
if not isinstance(param,Tie):
self._highest_parent_.ties.splitTies(param)
else:
self._highest_parent_.ties._update_label_buf()
if hasattr(self._highest_parent_,'ties'):
self._highest_parent_.ties._update_label_buf()
def add_parameter(self, *args, **kwargs):
raise DeprecationWarning, "add_parameter was renamed to link_parameter to avoid confusion of setting variables"