def __init__(self, **kwargs): """ Initialize handlers and inputs""" # NOTE: In python 2.6, object.__init__ no longer accepts input # arguments. HasTraits does not define an __init__ and # therefore these args were being ignored. #super(TraitedSpec, self).__init__(*args, **kwargs) super(BaseTraitedSpec, self).__init__(**kwargs) traits.push_exception_handler(reraise_exceptions=True) undefined_traits = {} for trait in self.copyable_trait_names(): if not self.traits()[trait].usedefault: undefined_traits[trait] = Undefined self.trait_set(trait_change_notify=False, **undefined_traits) self._generate_handlers() self.set(**kwargs)
def setup_package(): push_exception_handler(handler=lambda *args, **kwds: None, reraise_exceptions=True)
def setup(): # If a trait exception occurs, fail the test. push_exception_handler( handler = lambda o,t,ov,nv: None, reraise_exceptions = True, main = True, )