From a1aa8a347c6963c3e5eb05a9d07f55feb40a2bd4 2014-01-16 10:57:12 From: Jonathan Frederic Date: 2014-01-16 10:57:12 Subject: [PATCH] Revert 2853eb41 's changes to traitlets --- diff --git a/IPython/utils/traitlets.py b/IPython/utils/traitlets.py index 63cd5ce..31fb5cf 100644 --- a/IPython/utils/traitlets.py +++ b/IPython/utils/traitlets.py @@ -149,7 +149,7 @@ def parse_notifier_name(name): return ['anytrait'] elif isinstance(name, (list, tuple)): for n in name: - assert isinstance(n, basestring), "names must be strings: %s, %r"%(type(n), n) + assert isinstance(n, str), "names must be strings" return name @@ -801,14 +801,11 @@ class Instance(ClassBasedTraitType): if self._allow_none: return value self.error(obj, value) - try: - if isinstance(value, self.klass): - return value - else: - self.error(obj, value) - except TypeError as e: - print self.klass, type(self.klass) - raise TypeError("validate, %s, %s"%(self.klass, type(self.klass))) + + if isinstance(value, self.klass): + return value + else: + self.error(obj, value) def info(self): if isinstance(self.klass, py3compat.string_types):