From 20796f209b2f42ebf6cf629ffb485b822b4d33db 2015-04-07 20:49:35 From: Sylvain Corlay Date: 2015-04-07 20:49:35 Subject: [PATCH] minor fixes on custom serialization, and traitlet hold_traits --- diff --git a/IPython/core/application.py b/IPython/core/application.py index 918211b..c2e5f0c 100644 --- a/IPython/core/application.py +++ b/IPython/core/application.py @@ -215,7 +215,7 @@ class BaseIPythonApplication(Application): return crashhandler.crash_handler_lite(etype, evalue, tb) def _ipython_dir_changed(self, name, old, new): - if old is not None and old is not Undefined: + if old is not Undefined: str_old = py3compat.cast_bytes_py2(os.path.abspath(old), sys.getfilesystemencoding() ) diff --git a/IPython/html/static/widgets/js/widget.js b/IPython/html/static/widgets/js/widget.js index 5ad4ef5..6c39878 100644 --- a/IPython/html/static/widgets/js/widget.js +++ b/IPython/html/static/widgets/js/widget.js @@ -369,7 +369,7 @@ define(["widgets/js/manager", // being the value or the promise of the serialized value var serializers = this.constructor.serializers; if (serializers) { - for (k in attrs) { + for (var k in attrs) { if (serializers[k] && serializers[k].serialize) { attrs[k] = (serializers[k].serialize)(attrs[k], this); } diff --git a/traitlets/traitlets.py b/traitlets/traitlets.py index a739fcc..d2ed060 100644 --- a/traitlets/traitlets.py +++ b/traitlets/traitlets.py @@ -624,7 +624,7 @@ class HasTraits(py3compat.with_metaclass(MetaHasTraits, object)): if cache[name][1] is not Undefined: setattr(self, name, cache[name][1]) else: - delattr(self, name) + self._trait_values.pop(name) cache = {} raise e finally: