traits
traits copied to clipboard
Remove 'except Exception' guard from `TraitType.clone`
[From #1645]
Currently, in most cases TraitType.clone
with a new default value tries to validate that default value using self.validate(None, None, default_value)
. This can fail for trait types like This
which need a proper object and name for correct validation, so this code executes inside a try / except Exception
wrapper.
Those trait types should override clone
to implement their own behaviour, and then we can remove the catch-all-exceptions logic.