##// END OF EJS Templates
Don't calculate default value when setting traitlet for the first time
Thomas Kluyver -
Show More
@@ -199,11 +199,12 b' class BaseIPythonApplication(Application):'
199 199 return crashhandler.crash_handler_lite(etype, evalue, tb)
200 200
201 201 def _ipython_dir_changed(self, name, old, new):
202 str_old = py3compat.cast_bytes_py2(os.path.abspath(old),
203 sys.getfilesystemencoding()
204 )
205 if str_old in sys.path:
206 sys.path.remove(str_old)
202 if old is not None:
203 str_old = py3compat.cast_bytes_py2(os.path.abspath(old),
204 sys.getfilesystemencoding()
205 )
206 if str_old in sys.path:
207 sys.path.remove(str_old)
207 208 str_path = py3compat.cast_bytes_py2(os.path.abspath(new),
208 209 sys.getfilesystemencoding()
209 210 )
@@ -13,6 +13,7 b' This module does not import anything from matplotlib.'
13 13 # Imports
14 14 #-----------------------------------------------------------------------------
15 15
16 from IPython.config import Config
16 17 from IPython.config.configurable import SingletonConfigurable
17 18 from IPython.utils.traitlets import (
18 19 Dict, Instance, CaselessStrEnum, Set, Bool, Int, TraitError, Unicode
@@ -42,7 +43,7 b' class InlineBackend(InlineBackendConfig):'
42 43
43 44 def _config_changed(self, name, old, new):
44 45 # warn on change of renamed config section
45 if new.InlineBackendConfig != old.InlineBackendConfig:
46 if new.InlineBackendConfig != getattr(old, 'InlineBackendConfig', Config()):
46 47 warn("InlineBackendConfig has been renamed to InlineBackend")
47 48 super(InlineBackend, self)._config_changed(name, old, new)
48 49
@@ -415,7 +415,11 b' class TraitType(object):'
415 415
416 416 def __set__(self, obj, value):
417 417 new_value = self._validate(obj, value)
418 old_value = self.__get__(obj)
418 try:
419 old_value = obj._trait_values[self.name]
420 except KeyError:
421 old_value = None
422
419 423 obj._trait_values[self.name] = new_value
420 424 try:
421 425 silent = bool(old_value == new_value)
General Comments 0
You need to be logged in to leave comments. Login now