Show More
@@ -140,7 +140,7 b' class Configurable(HasTraits):' | |||
|
140 | 140 | my_config = self._find_my_config(cfg) |
|
141 | 141 | |
|
142 | 142 | # hold trait notifications until after all config has been loaded |
|
143 |
with self.d |
|
|
143 | with self.hold_trait_notifications(): | |
|
144 | 144 | for name, config_value in iteritems(my_config): |
|
145 | 145 | if name in traits: |
|
146 | 146 | if isinstance(config_value, LazyConfigValue): |
@@ -576,12 +576,12 b' class HasTraits(py3compat.with_metaclass(MetaHasTraits, object)):' | |||
|
576 | 576 | # We need to use setattr for this to trigger validation and |
|
577 | 577 | # notifications. |
|
578 | 578 | |
|
579 |
with self.d |
|
|
579 | with self.hold_trait_notifications(): | |
|
580 | 580 | for key, value in iteritems(kw): |
|
581 | 581 | setattr(self, key, value) |
|
582 | 582 | |
|
583 | 583 | @contextlib.contextmanager |
|
584 |
def d |
|
|
584 | def hold_trait_notifications(self): | |
|
585 | 585 | """Context manager for bundling trait change notifications |
|
586 | 586 | |
|
587 | 587 | Use this when doing multiple trait assignments (init, config), |
General Comments 0
You need to be logged in to leave comments.
Login now