You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Failed assignments to PrefixList cause a nested exception: we raise a TraitError, catch that raised error, and then raise another TraitError. This suggests a logic error somewhere.
>>> from traits.api import *
>>> class A(HasTraits):
... foo = PrefixList(["one", "two", "three"])
...
>>> a = A()
>>> a.foo = "t"
Traceback (most recent call last):
File "/Users/mdickinson/Enthought/ETS/traits/traits/trait_types.py", line 2526, in validate
self.error(object, name, value)
File "/Users/mdickinson/Enthought/ETS/traits/traits/base_trait_handler.py", line 76, in error
raise TraitError(
traits.trait_errors.TraitError: The 'foo' trait of an A instance must be 'one' or 'two' or 'three' (or any unique prefix), but a value of 't' <class 'str'> was specified.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/mdickinson/Enthought/ETS/traits/traits/trait_types.py", line 2530, in validate
self.error(object, name, value)
File "/Users/mdickinson/Enthought/ETS/traits/traits/base_trait_handler.py", line 76, in error
raise TraitError(
traits.trait_errors.TraitError: The 'foo' trait of an A instance must be 'one' or 'two' or 'three' (or any unique prefix), but a value of 't' <class 'str'> was specified.
The text was updated successfully, but these errors were encountered:
Failed assignments to
PrefixList
cause a nested exception: we raise aTraitError
, catch that raised error, and then raise anotherTraitError
. This suggests a logic error somewhere.The text was updated successfully, but these errors were encountered: